[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

fork or printf problem



Hi ,

running the output executable of the following program as

$a.out
and
$a.out > test

give different results
WHY??

****************************
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

main()
{

    printf("Hello\n");
    if(fork()==0)
    {
        printf("world\n");
    }
}

*****************************


TIA

Regards
Sumit