Anonymous
2013-03-20 12:56:19 UTC
#include
#include
#include
#include
using namespace std;
void type(char[]);
int main(){
type("Testing typewriter effect");
cout << "code after typewriter completed" << endl;
return 0;
}
void type(char st[]){
cout << "code right after type function completed" << endl;
for(unsigned int x = 0; x < strlen(st); x++){
cout << st[x];
srand(time(0));
int r = rand() % 55 + 30;
cout << "\n"; //it just won't work unless I put this line with \n , any other cout won't work
usleep(150*1000);
}
}