void smallarraymessage()
{
cout
<<" ************** SMALL array ************** \n\n"
<<"I am about to fully load smallArray with random generated numbers ... \n\n"
<<"Finish loading smallArray ... \n\n"
<<endl;
}//
//int smallarray(int random)
//{
int array[12] = {rand(),rand(),rand(),rand(),rand()};
srand((unsigned)time(0));
for (int i = 0; i < 12; i++)
{
array[i] = 1 + (rand() % 100);
cout << "I am about to call printArray (with the default value for the perline)... \n"
<< setw(5) << rand() << endl;
}system("pause");
return 0;
}
On thing: srand(...) shall be before any call to rand() because it seeds the random functionality. Thus it shall be called only once. The best would be at the top of main(...).