Sorry, looking back I can see i was far from clear in stating what I wanted to do, so let me try again.
I have this structure I am going to use.
struct Data
{
string division;
int Q1Sales;
int Q2Sales;
int Q3Sales;
int Q4Sales;
// Constructor
Data (string div = " ", int Q1 = 0, int Q2 = 0, int Q3 = 0, int Q4 = 0)
{
division = div;
Q1Sales = Q1;
Q2Sales = Q2;
Q3Sales = Q3;
Q4Sales = Q4;
}
};
What I want to do is have a way to create several instances ( an array) of this structure, either by a loop or other methods, without having to name each instance seperately. such as:
for (int count = 1; count <= 4; count ++ )
{
Data div[count](div, Q1, Q2, Q3, Q4);
}
But I know this wont work because the compiler wants a constant in the variable(count) location. I could do this, but then I would be limiting the number of possible instances which is what I am trying to avoid.