4
Answers

list.Add() problem

Jose Silva

Jose Silva

16y
3.9k
1
when using this:

list<string> other;
list<list <string>> listA;

listA.Add(other);
other.Clear();

both lists become empty...

how can i copy the info on list "other" to a list of lists (many "other" lists) without losing the info?

the idea is populate list "other", add it to "listA", then clear list "other" and start over...

plz help..

thanks in advance!


EDIT: fro now i have it working, i just copy all the info into an array and then copy it tho the other list... if anyone can help though, i'd love to know why this happens.. thanks
Answers (4)