error using random functions

Hello,
I am trying to execute the following program and I get an error. The error says that 'main' must return 'int'. I tried adding return 0 both within the main brackets and in the inner brackets but I still get the error. Can someone help? (this is an example from a textbook I am using!)

//example 04-11 - using random functions

#include <iostream>
#include <ctime>

using namespace std;
void main(void)
{
int i,j;
srand( (unsigned)time( NULL));
/*Display 10 numbers. */
for (i = 0; i < 10; i++)
{
j = rand();
cout << j << endl;
}

}

Thanks!

Margie
It must be int main()
You should drop your textbook and get a better one if it contains such glaring mistakes.
thank you! I'm considering it - this is around the 10 mistake I have encountered!
Margie
Topic archived. No new replies allowed.