Standard output and input streams are buffered by default. You can turn off output buffering by calling once before your while loop. https://en.cppreference.com/w/c/io/setbuf
Cout and iostream are C++ features, you can't use them from a C program. You need to change the source file suffix to .cpp and compile and link your code with g++ instead of gcc.
The options for gcc are documented here: https://gcc.gnu.org/onlinedocs/gcc-10.5 ... g-GCC.html
Code:
setbuf(stdout, NULL);
Cout and iostream are C++ features, you can't use them from a C program. You need to change the source file suffix to .cpp and compile and link your code with g++ instead of gcc.
The options for gcc are documented here: https://gcc.gnu.org/onlinedocs/gcc-10.5 ... g-GCC.html
Statistics: Posted by markkuk — Thu Mar 14, 2024 11:30 am