Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5011

C/C++ • Re: Hard time getting started

$
0
0
Standard output and input streams are buffered by default. You can turn off output buffering by calling

Code:

setbuf(stdout, NULL);
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

Statistics: Posted by markkuk — Thu Mar 14, 2024 11:30 am



Viewing all articles
Browse latest Browse all 5011

Trending Articles