louisgnarf
Programmer
Sorry for the ambiguous, nonsensical thread title.
What I have is a header file that defines a class...this file is the output of a particular program. So it's something like this:
class Box{
int List1 = [ 1 2 3 4 5 6 7 9 29 1];
int List2 = [ 1 2 3 4 5 6 7 9 29 1];
int List3 = [ 1 2 3 4 5 6 7 9 29 1];
...
int Listn = [ 1 2 3 4 5 6 7 9 29 1];
}
And so, I want my program to access each of these member variables...however, I don't want to type out "List" n many times, i.e.: "cout << List1;", "cout << List2;"...I want to do something like this (pseudocode, obviously):
string list = "List"
for(j=0; j<n; j++)
{
for(i=0; i<10; i++)
{
cout << Box.(List[j]);
}
}
How would I go about doing this? Sorry if this is confusing...
What I have is a header file that defines a class...this file is the output of a particular program. So it's something like this:
class Box{
int List1 = [ 1 2 3 4 5 6 7 9 29 1];
int List2 = [ 1 2 3 4 5 6 7 9 29 1];
int List3 = [ 1 2 3 4 5 6 7 9 29 1];
...
int Listn = [ 1 2 3 4 5 6 7 9 29 1];
}
And so, I want my program to access each of these member variables...however, I don't want to type out "List" n many times, i.e.: "cout << List1;", "cout << List2;"...I want to do something like this (pseudocode, obviously):
string list = "List"
for(j=0; j<n; j++)
{
for(i=0; i<10; i++)
{
cout << Box.(List[j]);
}
}
How would I go about doing this? Sorry if this is confusing...