I am fiddling with C++, and I was wondering if there is an equivalent for the C fflush(stdout) without using std::endl? As an example I am doing some really basic i/o stuff, in order to get my feet wet:
But I do want to flush the buffer.
std::cout << "\nThis program raises a number to a power:" << std::endl;
std::cout << "\nEnter the base number: "; // I don't want the newline from endl here
Ah - that sounds reasonable. Thanks.
std::cout.flush() as well.
If you're going to be asking for input next, you don't need to manually flush the buffer. Using std::cin will flush it.