0
How to "cout" Text letter by letter
Hi, I try to learn C++ at the moment and I want to figure out how to give out a text letter by letter (like you know from typewriters). Is there a special library I could use or how do I do this?
3 Answers
+ 2
Yes, with a for loop indeed
string test = "bottom text";
for(int i = 0; i < test.length(); ++i) cout << test[i] << endl;
(You may need to import <string>) Actually you don't need to
+ 2
How about making a char list and make it output one value at a time but not include the endl or \n at the end of cout? That could work.
0
Maybe it's good for single words, but is there a way to make it easier for a whole text? Maybe with a for loop?