Subj : Re: Class problems To : borland.public.cpp.borlandcpp From : Mark Manning Date : Mon Sep 13 2004 01:37 am This is correct. (That it doesn't make it any more correct.) But if the whole world is doing one thing and the manual says another. Then which is correct? I have (at last count) at least six C compilers and four C++ compilers. (At least that is how many I have checked so far.) And none of them give an error on this. Now, I haven't checked MetroWerk's C compiler on the Mac yet and I haven't booted up Windows XP (I use DOS 6.22, Windows v3.1, 95, and 98se but I also have Windows NT, Me, and XP I can try this on). Maybe one of them will say I can't do this but so far - no problem. Still, you are right - it doesn't make it any more correct. It's just - doesn't make it any more wrong either. However, in honor of you pointing this out - I have changed my program to reflect what you have said is the correct method to use. I decided that if I am going to write a program which will be used on a web server I might as well return a status so the Perl script which calls it can determine whether or not it terminated properly and since void doesn't return any kind of a status that I'd use int instead. Only where I work they frown on using int and insist on us using long for all return status'. Still, int is better if you are compiling for 16bit operations and 32bit operations because it usually switches depending upon which type of OS you are using. :-) Later! Found and fixed the error. Off to the next one. :-) Mark Thomas Maeder [TeamB] wrote: > "Mark Manning/Muniz Eng." writes: > > >>void main( int argc, char *argv[] ) is perfectly valid as long as exit >>is not used. > > > No. Both the C and the C++ language have always required the return type > of main() to be int. The ISO Standards for the languages require compilers > to produce a diagnostic message if the return type is different from void. > > There are many buggy compilers out there, including, I think all Borland > has ever released, that let you get away with main()'s return type being > void, but that doesn't make doing it any more correct. .