hi
is there a way to flush stdout before calling printf?
Printable View
hi
is there a way to flush stdout before calling printf?
Code:fflush(stdout);
ah ok pretty straight forward :) thanks mate ;)
Just curios - why do you need it BEFORE printf?
not exactly before printf... i said before printf to make the question more understandable for what i'm trying to do...
But what happened was that from after a fork i was calling a function, where while this function was getting executed before getting ready to print, the caller of the function was waiting on a signal to print a long stream, where when the child prints his stuff(before sending the signal it was getting mixed with the stuff of the caller which i didn't want to show yet.... Anyway tried to explain it... but it worked now :)