Δημοσιεύτηκε: 14 Ιουν 2011, 02:37
Υποθέτω είναι το ίδιο:
http://www.open-std.org/jtc1/sc22/WG14/ ... /n1256.pdf
http://www.gnu.org/s/hello/manual/libc/ ... ermination
http://www.utas.edu.au/infosys/info/doc ... html#abort
http://www.open-std.org/jtc1/sc22/WG14/ ... /n1256.pdf
έγραψε:5.1.2.2.3 Program termination
If the return type of the main function is a type compatible with int, a return from the
initial call to the main function is equivalent to calling the exit function with the value
returned by the main function as its argument;10) reaching the } that terminates the
main function returns a value of 0. If the return type is not compatible with int, the
termination status returned to the host environment is unspecified.
Forward references: definition of terms (7.1.1), the exit function (7.20.4.3).
http://www.gnu.org/s/hello/manual/libc/ ... ermination
έγραψε:A process terminates normally when its program signals it is done by calling exit. Returning from main is equivalent to calling exit, and the value that main returns is used as the argument to exit.
http://www.utas.edu.au/infosys/info/doc ... html#abort
έγραψε:void abort();
Terminates program abnormally, by calling raise(SIGABRT).
void exit(int status);
Terminates program normally. Functions installed using atexit are called (in reverse order to that in which installed), open files are flushed, open streams are closed and control is returned to environment. status is returned to environment in implementation-dependent manner. Zero or EXIT_SUCCESS indicates successful termination and EXIT_FAILURE indicates unsuccessful termination. Implementations may define other values.