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.
The compiler says a constant expression is required. The program works fine if I replace it withCode: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;
but wont accept the user input number.Code:HUMAN *human_array
How can I solve this problem?
Thanks in advance.