.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 23rd, 2002, 11:30 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Array Addresses

<i><b>Originally posted by : Kerry (whelan_kerry@hotmail.com)</b></i><br />Hello,<br /><br />I have two arrays of structures. I define the arrays of structures as follows:-<br /><br /> //initialisation<br /> ConfigApp.Config.ConfigCollection[] orgColl;<br /> ConfigApp.Config.ConfigCollection[] newColl;<br /><br />where ConfigApp is the namespace, Config is the Class Name and ConfigCollection is the name of the structure,<br /><br />and I have also tried defining the arrays in this way:-<br /><br /> ConfigApp.Config.ConfigCollection[] newColl = new ConfigApp.Config.ConfigCollection[2];<br /><br />I call my Get function to fill orgColl (one of the arrays of structures).<br /><br />When orgColl is returned I copy it to newColl.<br /><br />I have done this using:-<br /><br /> orgColl.CopyTo(newColl,0);<br /><br />and I have tried:-<br /> <br /> newColl = orgColl;<br /><br />Then I pass the collection by reference to a function that makes changes to it,<br /><br /> public void MakeChanges(ref ConfigApp.Config.ConfigCollection[] newColl)<br /> {<br /> //newColl = orgColl;<br /> newColl[0].attValue[0] = "newName";<br /> }<br /><br />When I return to the calling function I find that both orgColl and newColl have the value 'newValue' inserted at the point .attValue[0]<br /><br />How can I set up the arrays so that the orgColl's value is not changed when newColl's value is changed.<br /><br />Thankyou for any help,<br /><br />Kerry<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Array Addresses


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway