Jose Silva

Jose Silva

  • NA
  • 7
  • 0

list.Add() problem

Jun 30 2008 10:18 AM
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)