it means exit the program and return a value of 10 to the operating system as the programs result.
What 10 might mean is operating system dependant the only number with a defined meaning is 0 which must be interpreted as success. Normally any non-zero number is interpreted as fail in some manner.
at starting of prog. there is int j = (print"hello");
here is i is of integer type and hello is of char type then how can it possible....??
pls explain mi in detail this program from top to bottom.
The exit value can be tested by the entity (batch script, perl script, make, etc) that invoked the program. The meaning of any particular exit value depends on the program that returns it; but the implication of the exit value depends on how the invoking entity reacts to it.
FYI, the default behavior for make is to abort the build if any program returns with a nonzero exit value.
If you write a program that supports nonzero exit values then it is may be useful to print an explanatory error message to stderr before exiting. Printing the error message may be unconditional or you might choose to print it only if a command-line argument requests verbose output. Refer to the perror function for a means to print errors reported by Standard Library functions.
Last edited by donbock; Oct 18 '12, 12:29 PM.
Reason: Added paragraph about printing an error message.
Comment