Monday, September 27, 2010

What Does main( ) Return?

The main() function returns an integer to the calling process, which is generally the
operating system. Returning a value from main() is the equivalent of calling exit()
with the same value. If main() does not explicitly return a value, the value passed
to the calling process is technically undefined. In practice, most C/C++ compilers
automatically return 0, but do not rely on this if portability is a concern.

No comments:

Post a Comment