Part of the program creates objects of the class HUMAN and creates pointers to these objects. These pointers are the stored in an array. Anyway the user inputs the number of family members it wants to create and this number is used to specify the length of the human array.
Code:
int human_max;
std::cout << "\n\nPlease input the number of family members you would like to make: ";
std::cin >> human_max;
HUMAN *human_array[human_max];
HUMAN* ptr_h;
The compiler says a constant expression is required. The program works fine if I replace it with
Code:
HUMAN *human_array[10]
but wont accept the user input number.
How can I solve this problem?
Thanks in advance.