[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


Implicit Return Statement for main()

The compiler adds a


  return 0;

statement in C++ a program's main() function if the function returns an int result and doesn't end with a user return statement.

Examples:


  int main() { } // equivalent to:    // int main() { return 0; }
  main() { } // equivalent to:
   // int main() { return 0; }

The compiler will also enforce an external int main() function if ANSI Strict is on in the C/C++ Language Panel.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000