C++ slowprint
SilentShadowBla (554)

For people who are doing c++ and want a slowprint function, this took me a LONG time to figure out probs cuz im dumb...:)

You are viewing a single comment. View All
Mapaor4 (4)

Can u explain me the:

for(char c: word)

Never seen it

SilentShadowBla (554)

that basically saying as long as there are still characters in the string it will repeat the action @Mapaor4

Mapaor4 (4)

@SilentShadowBla Would this had been correct?:

for(int i = 0; i < word.size(); i++){
    cout << word[i] << flush;
SilentShadowBla (554)

yes longer but still effective @Mapaor4

ApoorvAgrawal (51)

@Mapaor4 It's a for-each loop. It's the same thing as for (x of cars) in javascript.