home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!decwrl!waikato.ac.nz!comp.vuw.ac.nz!cc-server4.massey.ac.nz!pnv.palm.cri.nz!hrpctw
- From: hrpctw@pnv.palm.cri.nz (Colin T. Wilson-Salt)
- Newsgroups: comp.lang.c++
- Subject: Function 'max' should have a prototype
- Message-ID: <hrpctw.14@pnv.palm.cri.nz>
- Date: 25 Jan 93 21:49:41 GMT
- Article-I.D.: pnv.hrpctw.14
- Sender: news@massey.ac.nz (USENET News System)
- Organization: DSIR, Palmerston North, New Zealand
- Lines: 21
-
- I can't seem to get the max() macro to work. It works OK under C, but
- under C++ it gives me the error "Function 'max' should have a prototype".
-
- I can compile the following example code from the Borland C manual
- as TEST.C fine:
-
- #include <stdlib.h>
- #include <stdio.h>
- int main(void)
- {
- int x = 5, y = 6, z;
- z = max(x, y);
- printf("The larger number is %d\n", z);
- return 0;
- }
-
- but if I rename the file TEST.CPP it won't compile.
-
- Is this an error in the #include file perhaps?
-
- Should I give up and write a replacement max() function/macro?
-