Share your repls and programming experiences

← Back to all posts
C++ slowprint
SilentShadowBla (541)

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

Mapaor4 (4)

Can u explain me the:

for(char c: word)

Never seen it

SilentShadowBla (541)

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 (541)

yes longer but still effective @Mapaor4

Roar123 (431)

This is nice! I don't know C++ and I can still appreciate it :)

AshleighBonner (0)

Thanks. I learned new functions. Great job!

Highwayman (1340)

REALLY nice code. very clean!