home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.internals
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!news.edu.tw!news!ccsun7.csie.nctu.edu.tw!mchuang
- From: mchuang@csie.nctu.edu.tw (Ming-Chuan Huang)
- Subject: printf() & fork() ......
- Message-ID: <1992Nov19.133035.172@ccsun7.csie.nctu.edu.tw>
- Sender: usenet@ccsun7.csie.nctu.edu.tw
- Organization: Computer Science & Information Engin., Chiao-Tung U, Taiwan, ROC
- X-Newsreader: TIN [version 1.1 PL6]
- Date: Thu, 19 Nov 1992 13:30:35 GMT
- Lines: 34
-
- Hello:
-
- #include <stdio.h>
-
- program 1:
-
- void main()
- {
- printf("Hello ");
- if (fork() == 0)
- printf("world\n");
- }
-
- result:
- Hello Hello world
-
- program 2:
-
- 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 ?
-
- mchuang
- mchuang@csie.nctu.edu.tw
-