write system call to file desciptor ZERO

Posted by shadyabhi on Stack Overflow See other posts from Stack Overflow or by shadyabhi
Published on 2010-04-14T16:26:23Z Indexed on 2010/04/14 16:33 UTC
Read the original article Hit count: 287

Filed under:
|
|
|
int main ( )
{
    char C[] = "Hello World";
    write(0,C,sizeof(C));
    return 0;
}

In the above program, I am writing to File descriptor ZERO which I suppose by default is STDIN.. Then why I am I getting output at STDOUT?

shadyabhi@shadyabhi-desktop:~$ ./a.out
Hello Worldshadyabhi@shadyabhi-desktop:~$

© Stack Overflow or respective owner

Related posts about c

    Related posts about gcc