for a uni assignment i have downloaded an example of a random number generator, and it dosen't work. it worked when it was demonstrated in the lecture but now it does not.
here is the code that i compiled aand got the errors from. i'm using microsoft visual studio 6 on wondows xp.
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
int main(void)
{
int dice[10];
int seed =(int)(time(0));
srand(seed);
for(int i = 0; i < 10; i++)
{
dice[i] = (rand() % 6) + 1;
}
for(int x = 0; x < 10; x++)
{
cout << dice[x] << " : ";
}
cout << endl;
return 0;
}
the errors are all in the time.h header file.
:\program files\microsoft visual studio\vc98\include\time.h(36) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
c:\program files\microsoft visual studio\vc98\include\time.h(208) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
c:\program files\microsoft visual studio\vc98\include\time.h(209) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\time.h(209) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\time.h(209) : error C2143: syntax error : missing ';' before '}'
c:\program files\microsoft visual studio\vc98\include\errno.h(29) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio\vc98\include\errno.h(29) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.
those are the error messages i get, anybody help?