H
Herve Bocuse
Hi,
I have a question dealing to value and reference types, boxing and unboxing.
I'm coming from the C++ world so I don't see how to do the following
feature:
I have several primitive types as members of a class. I would like to pass a
reference to these variables to somewhere else in the code and to be able to
modify the original variables from there.
So basically, how to store in a class C2 a reference to a primitive type of
another class C1 to be able to modify the primitive value from C2 ?
I understood the "ref" keyword but I can't use it because:
1. I can't store the reference. I can only use it in the called method.
2. I can't send a ref double and receive it as a ref object (because in the
receiver I want to be generic and store a reference on any value type).
Thanks a lot
Herve
I have a question dealing to value and reference types, boxing and unboxing.
I'm coming from the C++ world so I don't see how to do the following
feature:
I have several primitive types as members of a class. I would like to pass a
reference to these variables to somewhere else in the code and to be able to
modify the original variables from there.
So basically, how to store in a class C2 a reference to a primitive type of
another class C1 to be able to modify the primitive value from C2 ?
I understood the "ref" keyword but I can't use it because:
1. I can't store the reference. I can only use it in the called method.
2. I can't send a ref double and receive it as a ref object (because in the
receiver I want to be generic and store a reference on any value type).
Thanks a lot
Herve