Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!purdue!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: thanks for "down" answers Message-ID: <1082@goofy.megatest.UUCP> Date: 14 Dec 88 20:46:17 GMT References: <1886@loral.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 33 From article <1886@loral.UUCP>, by jlh@loral.UUCP (Physically Phffft): ... > In all his examples he used wait ( (char *) 0). > I pointed out to him that wait wanted an address in which to > stuff a result, and using 0 was probably not a good idea. His > reply was 'thats how it is in my manual', after a few minutes > of discussion it got upgraded to 'I tried it on my system and it > works'. Both perfectly valid and correct responces. From the manual: #include pid = wait(status) int pid; union wait *status; pid = wait(0) int pid; [Your instructor correctly casts the 0 to a pointer-type, which the manual omits.] If you want the status, you pass a non-null pointer and wait knows what to do. If you don't want the status, you pass a null pointer, and wait knows what *not* to do. To paraphrase Samuel L. Clemmons, I think that you will discover in couple of years that your instructors have learned quite a bit in the interim. :-)