|
-
April 24th, 2012, 03:37 PM
#1
How to copy a list to another?
I have two same types of lists: list1 and list2. and the program has a structure as follows. each i loop the list1 size changes. I want to use list2 to keep data in list1 before calling func5() if condition1 is satisfied. how can I do this? Thanks
The code structure:
main()
{
List<class>List1 = new List<class> ();
loadup List1;
List<class>List2 = new List<class> ();
for int i=1; i<=5;i++
{
...
if(!func(ref List1))
{
...
}
...
}
bool func(ref List<class>list1)
{
func1(ref list1);
func2(ref list1);
if (condition1 is true)
{
func3(ref list1);
func4(ref list1);
func5(ref list1);
...
}
return true;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|