ArrayList??# DotNet - 窗口里的风景
c*o
1 楼
When I want to add an arrayList's content to another ArrayList,i.e.
al.add(alSon), C# adds the reference of alSon rather than its value to al. Any
one know how to figure it out if I only want to add a content of alSon to al,
and then the content of alSon will be refreshed and added to the al in a loop?
Currently, because the reference of alSon is used, so only duplicated values
of the last asSon are added to al.
Thank you!
ArrayList al=new ArrayList()
ArrayList alSon=new ArrayList()
for (...){
al.add(alSon), C# adds the reference of alSon rather than its value to al. Any
one know how to figure it out if I only want to add a content of alSon to al,
and then the content of alSon will be refreshed and added to the al in a loop?
Currently, because the reference of alSon is used, so only duplicated values
of the last asSon are added to al.
Thank you!
ArrayList al=new ArrayList()
ArrayList alSon=new ArrayList()
for (...){