Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
max()
Return the greater of two numbers
Synopsis:
#include <stdlib.h> #define max(a,b) ...
Arguments:
- a,b
- The numbers that you want to get the greater of.
Description:
The max() function returns the greater of two values.
![]() |
The max() function is for C programs only. For C+ and C++ programs, use the __max() or __min() macros. |
Examples:
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
int a;
a = max( 1, 10 );
printf( "The value is: %d\n", a );
return EXIT_SUCCESS;
}
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |
See also:
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
