Good afternoon all,
I appreciate that the standard requires that main should return an
integer. What I was wondering though is there any accepted
standardisation on exactly what value to return - do people tend to
return 0 or 1 or anything else? In addition, if there has been some
failure, do people tend to return another value (such as -1?)
Is there any standard for operating systems to handle the C return
value in a particular way (I know some ignore it and some do not) ?
For instance, if OS A regards return value 0 as successes and OS B
regards return value 0 as failure then surely this would affect the
portability of the C code?
Cheers,
Nick
I appreciate that the standard requires that main should return an
integer. What I was wondering though is there any accepted
standardisation on exactly what value to return - do people tend to
return 0 or 1 or anything else? In addition, if there has been some
failure, do people tend to return another value (such as -1?)
Is there any standard for operating systems to handle the C return
value in a particular way (I know some ignore it and some do not) ?
For instance, if OS A regards return value 0 as successes and OS B
regards return value 0 as failure then surely this would affect the
portability of the C code?
Cheers,
Nick
Comment