I want to initialize an array of stationary objects. I am taking input of number_of_stationary_items
in the constructor.
The error I get is:
invalid use of non-static data member
Here is how I am doing it:
class Inventory
{
int number_of_stationary_items;
Stationary S1[number_of_stationary_items];
public:
Inventory()
{
cout << "Enter number of stationary items: ";
cin >> number_of_stationary_items;
}
};