Click here to Skip to main content
16,011,358 members
Home / Discussions / C#
   

C#

 
AnswerRe: Copy or reference? Pin
Rüpel5-Jul-02 2:21
Rüpel5-Jul-02 2:21 
GeneralRe: Copy or reference? Pin
Nick Parker5-Jul-02 18:54
protectorNick Parker5-Jul-02 18:54 
AnswerRe: Copy or reference? Pin
leppie5-Jul-02 4:35
leppie5-Jul-02 4:35 
GeneralRe: Copy or reference? Pin
SimonS5-Jul-02 10:00
SimonS5-Jul-02 10:00 
GeneralRe: Copy or reference? Pin
James T. Johnson5-Jul-02 16:18
James T. Johnson5-Jul-02 16:18 
AnswerRe: Copy or reference? Pin
James T. Johnson5-Jul-02 16:35
James T. Johnson5-Jul-02 16:35 
GeneralRe: Copy or reference? Pin
Daniel Strigl7-Jul-02 20:46
Daniel Strigl7-Jul-02 20:46 
GeneralRe: Copy or reference? Pin
James T. Johnson7-Jul-02 22:18
James T. Johnson7-Jul-02 22:18 
jb_dani wrote:
Sorry for my bad english

Thats ok, I was able to read everything just fine Smile | :)

jb_dani wrote:
In your sample program is 'a' an 'int' with the value '1' and 'o' a reference to a copy of 'a', is that right?

Correct.

jb_dani wrote:
And 'o2' is a reference to 'o', is that also right?

What happens here would be much clearer if we had the C++ syntax.

object *o, *o2;
int i;

i = 1;

o = __box(i);  // box i and point o at it

o2 = o; // o2 now points to what o points at

i = 3; // Doesn't effect what o or o2 points at 
// because they point at a boxed copy of i, not to i itself

o = __box(i); // o now points at a new copy of i

// o2 still points at the original boxed copy of i.
If you don't understand C++ I hope the comments clarify it for you Smile | :)

James
"Java is free - and worth every penny." - Christian Graus
GeneralRe: Copy or reference? Pin
Daniel Strigl7-Jul-02 22:26
Daniel Strigl7-Jul-02 22:26 
AnswerRe: Copy or reference? Pin
7-Jul-02 16:01
suss7-Jul-02 16:01 
Generalenabling pictures during processing Pin
Rüpel5-Jul-02 1:02
Rüpel5-Jul-02 1:02 
GeneralRe: enabling pictures during processing Pin
Rüpel5-Jul-02 2:06
Rüpel5-Jul-02 2:06 
GeneralRe: enabling pictures during processing Pin
leppie5-Jul-02 2:08
leppie5-Jul-02 2:08 
GeneralRe: enabling pictures during processing Pin
Rüpel5-Jul-02 2:28
Rüpel5-Jul-02 2:28 
GeneralEXCEL Access Pin
Özgür5-Jul-02 0:22
Özgür5-Jul-02 0:22 
GeneralRe: EXCEL Access Pin
7-Jul-02 16:16
suss7-Jul-02 16:16 
GeneralRemove focus from Form Pin
Bo Norgaard4-Jul-02 20:47
Bo Norgaard4-Jul-02 20:47 
GeneralRe: Remove focus from Form Pin
Bo Norgaard4-Jul-02 23:21
Bo Norgaard4-Jul-02 23:21 
GeneralWrite User in the Event Log Pin
Vanclei4-Jul-02 4:50
Vanclei4-Jul-02 4:50 
Generalunsafe code Pin
Member 169774-Jul-02 2:23
Member 169774-Jul-02 2:23 
GeneralRe: unsafe code Pin
James T. Johnson4-Jul-02 7:07
James T. Johnson4-Jul-02 7:07 
GeneralRe: unsafe code Pin
Nish Nishant4-Jul-02 15:24
sitebuilderNish Nishant4-Jul-02 15:24 
GeneralOk You C# People Pin
Swinefeaster4-Jul-02 1:11
Swinefeaster4-Jul-02 1:11 
GeneralRe: Ok You C# People Pin
leppie4-Jul-02 2:37
leppie4-Jul-02 2:37 
GeneralRe: Ok You C# People Pin
leppie4-Jul-02 10:51
leppie4-Jul-02 10:51 

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.