I wrote an instruction printf()as shown below:
printf()
printf("hello\n");
this works great when built using the Linux gcc compiler. However, if I write
printf("hello");
Printing does not appear on the screen. Does it seem to have some kind of buffer mechanism? Can someone give me more info about this?
Even if buffering is not a problem, if you are not printing a new line, prompting your shell may discard the output.
, , , , gcc unix, printf ( "" ), . , , .
fflush(). , , . A\n , ( ), - .
here IO .
c- setvbuf
setvbuf(stdout, (char *)NULL, _IONBF, 0); //unbuffered stdout
Source: https://habr.com/ru/post/1717431/More articles:Замок Виндзор: Как получить прокси для конкретного экземпляра? - c#How to determine if it is communicating with Indy? - delphiIs it possible to reprogram the keyboard? - embeddedОтображение Nhibernate без id - c#Why does this generate a compiler warning "Signed / Unsigned mismatch" only when compiling under x64? - c ++FluentNHibernate for Dictionary - nhibernateVisual Basic Vs Dreamweaver CS4 - dreamweaverHow to implement a menu in the style of a Snow Leopard dock? - objective-cIs it possible to know exactly which numpad key is pressed in AS3 (with Num Lock disabled)? - flexGate catalog structure - javaAll Articles