What header files are the functions min (int, int) and max (int int) in?
What header files are the functions min (int, int) and max (int int) in?
Those who live by the sword get shot by those who don't.
I can C.
Compiler: gcc
#include "mycustomhearder.h"
Create your own functions.
Quzah.
Hope is the first step on the road to disappointment.
I don't know about gcc, but for borland compilers, they are in stdlib.h.
Maybe someone else knows where they are for gcc.
In C99, you can use the isgreater and isless macros defined in math.h. In C90 you're on your own:
Code:int min(int a, int b) { return (a < b) ? a : b; } int max(int a, int b) { return (a > b) ? a : b; }
p.s. What the alphabet would look like without q and r.
If you don't want to have to overload it for different datatypes, just use:
Code:#define min( x, y ) ( x < y ? x : y ) #define max( x, y ) ( x > y ? x : y )
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
>If you don't want to have to overload it for different datatypes
You wouldn't be able to anyway. Overloading is illegal in C.
p.s. What the alphabet would look like without q and r.
Really?
Shows how much I know about/use C. :P
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie