🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.internals
Article #2392

printf() & fork() ......

#2392
From: Ming-Chuan Huang
Date: Thu, 19 Nov 1992 13:30
34 lines
1012 bytes
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
Technical Details
Message-ID: <1992Nov19.133035.172@ccsun7.csie.nctu.edu.tw>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!news.edu.tw!news!ccsun7.csie.nctu.edu.tw!mchuang

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.internals
Path: arc1-ca.pugleaf.net!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