1. I want to create a function that will receive as input a sentense and display it slowly (like it's typed that moment from a user).
2. I was womdering if there is a way to delete a character that is displayed with cout<<. The aim is to have a dot blinking (display with cout and then delete a couple of times), like the user is waiting for the CPU to process data.
Null: Thabks for the suggestions. I had tried with string, but I was doing something wrong (I propably forgot to add #include<string>.
As for the blinking problem, it worked exactly as I wanted. Thank you so much. Here's the function. It shows three dots appearing gradually and dissapearing three times.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
void blinking () {
cout << "\nPlease wait while we process your request";
for (int i = 1; i < 4; i++) {
string blink = ".";
cout << blink;
Sleep(400);
cout << blink;
Sleep(400);
cout << blink;
Sleep(400);
cout << "\b \b";
cout << "\b \b";
cout << "\b \b";
Sleep(400);
}
cout << endl;
}
Another option I also liked is the blinking cursor I get If instead the for loop, I add a Sleep(5000). That's OK for me too.