On Tue, 17 Dec 2002 21:52:51 -0800 (PST)
Tapeshwar Nath wrote:
Well i think this is related to stack and how the data
is stored by the OS in stack.
The return value for that function would be undefined. It
would vary with different combinations of operating systems and
compilers. Yes, it's got to do with how the compiler would
manage the stack and what policies it has for otherwise undefined
behavior. I got 0 with gcc 3.2, sleep() or no sleep().
the return result was 0. Or if we give a specific
return then that value appears in the printf.
Of course, it would.
A quick look for functions and return values through
_The_C_Programming_Language_ 2/e by Kernighan and Ritchie should
leave no scope for doubts.
Tahir Hashmi (VSE, NCST)
tahir AT ncst DOT ernet DOT in
We, the rest of humanity, wish GNU luck and Godspeed