I am trying to create a for loop that creates an array of objects. I have a base class(god) and a derived class(people).
Code:
-----------------------------------------------------------------------------
...
cout << "\nMake new people\n";
cout << "\nEnter the number of people you want created\n";
cin >> NumberOfPeople;
******* god* Array[NumberOfPeople];
for(x = 0; x < NumberOfPeople; x++)
{
Array[x] = new person;
};
...
-------------------------------------------------------------------------------
I have three errors on the line with the asterisks
they are:
1) error C2057: expected constant expression
2) error C2466: cannot allocate an array of constant size 0
3) error C2133: 'Array' : unknown size
I compiled under Visual Studio, I don't think posting the rest of the code is necessary.