I want to make a func similar to a printf but that make the text appears slowly, by using a double for, one to print a char and one to take time:
char phrase[30]={"Printf random"};
for(int a=0;a<=30;a++){
printf("%c",phrase[a]);
for(int t=0;t<=1000000;t++){
int f;
f++;
}
}
but when I run, at first, it take some seconds (for the second for), and then it print all the phrase.
Why doesn't it enter the second for every time the firs one does? Maybe once the program calculates the second for the first time, it don't take time to calculate it again? how can i fix it?