I'm trying to create a program where text is outputted to the console with a character by character delay. (Also, I'm pretty new to this, so I don't have a very great understanding on how cout works.)
int main() {
std::cout << "L";
waitms(1000); //function that pauses 1 second.
std::cout << "l";
waitms(1000);
std::cout << "a";
waitms(1000);
std::cout << "m";
waitms(1000);
std::cout << "a";
}
When this code is ran, the console waits for four seconds and then prints Llama to the console.
This can work if you add \n characters to the end of the strings, but it produces an undesirable output.
Code: (waits four seconds) Llama
Undesired: L (does wait, but adds newlines.)
l
a
m
a
Desired: L (wait 1 second) l (wait) a (wait) m (wait) a
Llama
Is there any way to pop the stream without a newline?