On Wed, 28 Apr 1999, Amol Mohite wrote:
oh goodie, more homework to do :)
# In gcc,
#
# if i = 2;
# then j = i++ + ++i;
#
# what is the value of j.
6.
# what is the calling sequence in this case ? ++i first or i++ first ?
it'd do this:
i = 2
i++ /* add 1 to i and return 2 */
i = 3
++i /* add 1 to i and return 4 */
add 2 and 4 and give you 6.
#
# why does fork have to return a value of zero to the child process ?
if you have to ask this then you've never written a program that uses
fork() and understood it.
# why not -5 or -6 ?
because in the switch statement you wouldn't know if you were in a parent
or child.
let me know what grade you got for that homework :)
--
+++ The program isn't debugged until the last user is dead. +++
[EMAIL PROTECTED] http://www.penguinpowered.com/~a_out