Re: return codes for void main() blocks
- From: "Eugene Gershnik" <gershnik@xxxxxxxxxxx>
- Date: Sat, 28 Oct 2006 19:28:35 -0700
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
.
- References:
- return codes for void main() blocks
- From: Hector Santos
- Re: return codes for void main() blocks
- From: Eugene Gershnik
- Re: return codes for void main() blocks
- From: Hector Santos
- return codes for void main() blocks
- Prev by Date: Re: Immortal console window
- Next by Date: Re: How to create an all-user writable file
- Previous by thread: Re: return codes for void main() blocks
- Next by thread: Re: return codes for void main() blocks
- Index(es):