Quote:
Originally Posted by
majid.merkava
Hi guys,
Using gdb when we run executable it doesn't show the output of our program(such as printf, ...). it shows all of them when execution finishes. Is there any solution?
What exactly do you mean? the output of printf() literally doesn't appear anywhere until the program finishes?
That's probably because printf() is buffered. It holds the data in memory until you print a newline character. Try fprintf(stderr, ...); stderr defaults to unbuffered so should print immediately.