This still has errors :
Code:
#include <iostream.h>
#include <time.h>
#include <windows.h>
#include <conio.c>
int rand_mid(int low, int high)
{
srand(time(NULL));
return low + rand()%(high-low+1);
}
char dec[10][] = {"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","TEN"}; // ERROR
int main()
{
cout << dec[rand_mid(1,10)] << endl << endl; // ERROR 2
system("pause");
return 0;
}
I get the following error :
declaration of 'dec' as multidimensional array
must have bounds for all dimensions except the first
assignment (not initialization) in declaration
Error 2 :
ANSI C++ forbids using pointer to a function in arithmetic
What's wrong now ? Thanks.