I want write once program but I can't!, if we write "cout<<"Hello world" ; in a console we can see momental"hello world" and nothing, but now I want see hello world like a gif animation, every letters must be showing step by step, first "H" second "e" and "l" all letters step by step in every sek time, it's possible?, excuse me I am Russian. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I want write once program but I can't!, if we write "cout<<"Hello world" ; in a console we can see momental"hello world" and nothing, but now I want see hello world like a gif animation, every letters must be showing step by step, first "H" second "e" and "l" all letters step by step in every sek time, it's possible?, excuse me I am Russian.

16th Sep 2016, 3:45 PM
sirojiddin
2 Answers
+ 3
Try this: #include <iostream> #include <pthread.h> using namespace std; int main() { string s = "Hello world!"; int i; for (i = 0; i < s.length(); i++) { cout << s[i]; sleep(1); } cout << endl; return 0; }
16th Sep 2016, 4:20 PM
Zen
Zen - avatar
0
Error : "Sleep was not declared in this Scope"
16th Sep 2016, 7:14 PM
Dennis Wiebler
Dennis Wiebler - avatar