Recently in the programming of Linux network, always encountered such a thing, the program logic is not wrong, but the program run to a place to stop there, and later found in PRINRF () to add a line to run normally, such as "printf (" 123 "); "Change to" printf ("123\n"); "Just fine.
Slowly found a blog post can explain the problem: Blog Link: http://blog.csdn.net/ferlansue/article/details/7925522
The explanations are as follows:
printf will send things to the buffer, and if the buffer does not flush to the words, you will not see things on the screen, but can cause the buffer to flush to the situation has these:
1 force flush Standard output Cache fflush (stdout);
2, put the buffer into the content containing/n/r;
3, the buffer is full;
4, need to take things from the buffer time, such as the implementation of scanf;
In Linux programming, printf shows no line-wrapping buffering problem