J
Jon Slaughter
I'm using C++ and I'm trying to create a list of a list and it won't let me
create an iterator for it. if I do a list of an int, everything is fine.
my syntax is
list<list<string> > some_list;
and my iterator would be someting like
list<list>::Iterator blah;
or maybe
list<list<string> >::Iterator blah;
??
neither work, ofcourse.
basicaly I'm trying to parse a text file, each line is token that contains
tokens and I have a function that takes a string and returns the list of the
tokens. so I have my the parent list to contain lists to the tokens.
so I need to push onto the list
so in some sense Parent_List is "tokenized" version of the ith line in
the text file.
I thought about using a pointer to list<strings>, but then I'd have to
allocate the memory and I'd rather let C++ do all the dirty work. but even
then I had a problem allocating memory for my list<string> **ptr_list = new
list<string>[30]?
any idea's?
create an iterator for it. if I do a list of an int, everything is fine.
my syntax is
list<list<string> > some_list;
and my iterator would be someting like
list<list>::Iterator blah;
or maybe
list<list<string> >::Iterator blah;
??
neither work, ofcourse.
basicaly I'm trying to parse a text file, each line is token that contains
tokens and I have a function that takes a string and returns the list of the
tokens. so I have my the parent list to contain lists to the tokens.
so I need to push onto the list
so in some sense Parent_List is "tokenized" version of the ith line in
the text file.
I thought about using a pointer to list<strings>, but then I'd have to
allocate the memory and I'd rather let C++ do all the dirty work. but even
then I had a problem allocating memory for my list<string> **ptr_list = new
list<string>[30]?
any idea's?