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.
2 Antworten
+ 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;
}
0
Error : "Sleep was not declared in this Scope"



