I am learning to program in C. Could you explain why nothing is printed here?
#include
int main (void)
{
char a[]="abcd
Doing a fflush() could be expensive if you also have other streams other than stdout open for write, like say a file outputting to disk. Running fflush() will flush all streams not just stdout. It would be better to be more specific and pass the stream to flush. So for printf() which outputs to stdout you'd use fflush(stdout). A alternative if you're looking to output errors would be to use stderr as that's unbuffered with fprintf().
Also you can use setvbuf to change an open streams buffer before writing to it. See man setvbuf