Borland C++ reference

max

raw OCR

Returns the larger of two values.

Defined in header <stdlib.h>

Syntax

#include <stdlib.h>
(type) max(fl, h);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

This macro compares two values and returns the larger of the two. Both arguments and the macro declaration must be of the same type.

Return value

max returns the larger of two values.

See also

Example

#include <stdlib.h>
iinclude <stdio.h>

int main(void)

   int X = 5, y = 6, z;
   z = max (X, y);
   printfC'The larger number is  %d\n", z);
   return 0;

Program   output

The larger number is

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.