A few days ago i saw a program that printing(cout) words slowly
In normal cout - it will print the word immediately
I want to know how to print the word by character,character.
For example
Instead of printing" Hello" immediately
I want to know how to print it like this :-
print "H" then after a fraction of a seconds print "e" and so..
I heard you can write it as" nested for loop ".
Can someone teach me how to do that please?
Thanks
Pause might ask for the user to "press any key to continue." If you have access to it, use Sleep(). Or you can use a for loop to run x times the length of the character array you want to print, and use a modulus to print every ith iteration of the loop.
What he means is: Once you build your code in Release mode, that loop will be removed thanks to optimizations. You should use Win32's Sleep, or build your own with clock().
I have an assignment and i add this to make it more attractive at the end of my code.
Word of Warning: Silly little bells & whistles to make your console programs output look cute are generally to be avoided (unless you're writing the code for children or something). Most real users will just be annoyed or think your code has bugs. Once you get into GUI programming you can use all the pretty fonts, colors and graphics. In console programs it's better to just concentrate on writing good code.