nested lists
Posted: 12 Dec 2005, 01:57
Say i want to make nested lists but im nesting arrays of lists like these:
The above were all initialized, declared etc properly and work. Now i want to stick those lists in one bigger list (having each list, eg ground_factories as an element)
I looked up in the internet and found nothing related to this
so i tried things like:
I get an error:
How would i implement this?
Code: Select all
ground_factories = new list<int>[numOfSides];
sea_factories = new list<int>[numOfSides];
ground_defenses = new list<int>[numOfSides];
I looked up in the internet and found nothing related to this

Code: Select all
list<list<int>> *all_lists;
all_lists = new list<list<int>>;
all_lists.push_back(ground_factories);
Code: Select all
.\UnitTable.cpp(37) : error C2228: left of '.push_back' must have class/struct/union
type is 'std::list<_Ty> *'
with
[
_Ty=std::list<int>
]
did you intend to use '->' instead?