Return the lesser of two numbers
#include <stdlib.h>
#define min(a,b) ...
- a,b
- The numbers that you want to get the lesser of.
The min() function returns the lesser of two values.
 |
The min() function is for C programs only. For C+ and C++
programs, use the __max() or __min() macros. |
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
int a;
a = min( 1, 10 );
printf( "The value is: %d\n", a );
return EXIT_SUCCESS;
}
QNX 4
| Safety: | |
| Cancellation point |
No |
| Interrupt handler |
Yes |
| Signal handler |
Yes |
| Thread |
Yes |
max()