Re: return codes for void main() blocks



Hector Santos wrote:
Anyway, you're right. Its undefined, but it not something you can't
ignore also. Even if you do properly use int main(), you have to set
"something" and who knows what the calling process might take that to
mean. :-) Do you naturally use ZERO or a NON-ZERO for a int main()
where you really have no definition for it? These are rethorical
questions. :-)

Actually they are not. Both C and C++ define two constants EXIT_SUCCES, and
EXIT_FAILURE as arguments for exit() and return values for main(). They map
to the "natural" values for the platform and you can portably return them
to signify general success or failure. You can find the actual values of
both constants in stdlib.h

[all of the above typed from memory. please validate with your
documentation]

--
Eugene
http://www.gershnik.com


.