home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.internals
- Path: sparky!uunet!gumby!destroyer!news.iastate.edu!john
- From: john@iastate.edu (John Hascall)
- Subject: Re: printf() & fork() ......
- Message-ID: <By4Lt5.3qM@news.iastate.edu>
- Sender: news@news.iastate.edu (USENET News System)
- Organization: Iowa State University, Ames, IA
- References: <1992Nov19.133035.172@ccsun7.csie.nctu.edu.tw>
- Date: Sun, 22 Nov 1992 16:29:29 GMT
- Lines: 26
-
- mchuang@csie.nctu.edu.tw (Ming-Chuan Huang) writes:
- ~void main() {
- ~ printf("Hello ");
- ~ if (fork() == 0) printf("world\n");
- ~}
- ~result: Hello Hello world
-
- ~void main() {
- ~ printf("Hello \n");
- ~ if (fork() == 0) printf("world\n");
- ~}
- }result: Hello
- world
- ~is there anybody who knows the difference between the two programs ?
-
- Yes.
-
- John
- (hint: try comp.unix.questions)
-
- (useful hint: `line buffered')
- --
- John Hascall ``An ill-chosen word is the fool's messenger.''
- Systems Software Engineer
- Project Vincent
- Iowa State University Computation Center + Ames, IA 50011 + 515/294-9551
-