Hi I was wondering how I could have a pause in the program for a certain amount of time. Something like this:
Code:
#include <stdio.h>
#include <time.h>
#include <iostream>
using namespace std;
void wait ( int seconds )
{
clock_t endwait;
endwait = clock () + seconds * CLK_TCK ;
while (clock() < endwait) {}
}
void main()
{
text=getfile(filename);
cout << "Please wait";
foutopen(filename);
for(int c=0;c<3;c++)
{
cout << ". ";
wait(1);
}
letterfrequency(letfreq, text);
getwords(words, text);
sort(words,0,words.length()-1);
apvector <int> wordfreq(words.length(),-1);
wordfrequency(wordfreq, words);
output(letfreq, wordfreq, words, filename);
}
ignore the apvector and apstring stuff (it's a school program and they're gay and make me use it...
I found this wait function at cplusplus.com and it worked by itself but when i put it into this code it doesn't work right. Any help would be greatly appreciated