Hi,
I got this code from a c puzzles site. Not able to figure out, why such output is coming.
This code doesn't prints hello-out. The output is -
hello-errhello-errhello-err.....
What could be the reason?
I got this code from a c puzzles site. Not able to figure out, why such output is coming.
Code:
#include <stdio.h>
#include <unistd.h>
int main()
{
while(1)
{
fprintf(stdout,"hello-out");
fprintf(stderr, "hello-err")
sleep(1);
}
return 0;
}
hello-errhello-errhello-err.....
What could be the reason?
Comment