Click here to Skip to main content
15,897,891 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem to set AllowDrop from callback Pin
S. Senthil Kumar13-Nov-05 4:42
S. Senthil Kumar13-Nov-05 4:42 
GeneralRe: problem to set AllowDrop from callback Pin
xjsun13-Nov-05 7:30
xjsun13-Nov-05 7:30 
GeneralRe: problem to set AllowDrop from callback Pin
Leslie Sanford13-Nov-05 9:24
Leslie Sanford13-Nov-05 9:24 
GeneralRe: problem to set AllowDrop from callback Pin
xjsun13-Nov-05 19:45
xjsun13-Nov-05 19:45 
QuestionWhy the output is like this ? Pin
Kamrul Hasan12-Nov-05 9:14
Kamrul Hasan12-Nov-05 9:14 
AnswerRe: Why the output is like this ? Pin
Joshua Quick12-Nov-05 10:04
Joshua Quick12-Nov-05 10:04 
GeneralRe: Why the output is like this ? Pin
Kamrul Hasan12-Nov-05 22:33
Kamrul Hasan12-Nov-05 22:33 
GeneralRe: Why the output is like this ? Pin
Joshua Quick12-Nov-05 23:00
Joshua Quick12-Nov-05 23:00 
Member variable "list" is a reference to the ArrayList object and not the object itself. The important thing you need to learn here is the difference between "reference types" and "value types".

All classes such as ArrayList are reference types. Class objects are created via "new" and they only exist in the heap (not the stack). "new" merely returns a reference to that new object. So, when you pass an object reference to a function, you are merely passing a copy of that reference and not a copy of that object.

All structures such as int, long, and float are value types. These types are created on the stack and are not referenced. And yes, they really are structures. int maps to the System.Int32 structure. float maps to the System.Single structure.
So, when you pass a value type into a function, you are passing a copy of its data.

I'm not sure what your goal is here, but if you want to pass a copy of your ArrayList object into your changeItem() function, then you're going to need to clone it. Cloning an object will create a new object having the same object data.

changeItem((ArrayList)list.Clone());

I hope this helps!
GeneralRe: Why the output is like this ? Pin
S. Senthil Kumar13-Nov-05 4:55
S. Senthil Kumar13-Nov-05 4:55 
GeneralRe: Why the output is like this ? Pin
Joshua Quick13-Nov-05 10:02
Joshua Quick13-Nov-05 10:02 
QuestionGrouping Radio Buttons Pin
Kamrul Hasan12-Nov-05 8:33
Kamrul Hasan12-Nov-05 8:33 
AnswerRe: Grouping Radio Buttons Pin
Joshua Quick12-Nov-05 10:09
Joshua Quick12-Nov-05 10:09 
AnswerRe: Grouping Radio Buttons Pin
da vinci coder13-Nov-05 12:03
da vinci coder13-Nov-05 12:03 
QuestionReadOnly Radio Button? Pin
rich_wenger12-Nov-05 8:25
rich_wenger12-Nov-05 8:25 
AnswerRe: ReadOnly Radio Button? Pin
Colin Angus Mackay12-Nov-05 8:28
Colin Angus Mackay12-Nov-05 8:28 
GeneralRe: ReadOnly Radio Button? Pin
rich_wenger12-Nov-05 12:03
rich_wenger12-Nov-05 12:03 
GeneralRe: ReadOnly Radio Button? Pin
Kamrul Hasan12-Nov-05 22:42
Kamrul Hasan12-Nov-05 22:42 
GeneralRe: ReadOnly Radio Button? Pin
rich_wenger13-Nov-05 3:13
rich_wenger13-Nov-05 3:13 
GeneralRe: ReadOnly Radio Button? Pin
Dan Neely14-Nov-05 2:10
Dan Neely14-Nov-05 2:10 
GeneralRe: ReadOnly Radio Button? Pin
rich_wenger14-Nov-05 4:50
rich_wenger14-Nov-05 4:50 
GeneralRe: ReadOnly Radio Button? Pin
Kamrul Hasan14-Nov-05 6:24
Kamrul Hasan14-Nov-05 6:24 
GeneralRe: ReadOnly Radio Button? Pin
rich_wenger14-Nov-05 8:44
rich_wenger14-Nov-05 8:44 
GeneralRe: ReadOnly Radio Button? Pin
Kamrul Hasan15-Nov-05 2:12
Kamrul Hasan15-Nov-05 2:12 
QuestionHaving problems with getting current username in Windows... Pin
VampireLord12-Nov-05 7:35
VampireLord12-Nov-05 7:35 
AnswerRe: Having problems with getting current username in Windows... Pin
Colin Angus Mackay12-Nov-05 8:12
Colin Angus Mackay12-Nov-05 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.