R
Rafael Veronezi
Just to fix, correct me if I am wrong...
With reference types (objects), if I assign an object to another, the
assignment will be the address of the object, and not a copy of it's
contents right?
With value types (structs), if I assign an object to another, I'll be
copying it's data to the left side of the assignment, and not it's address.
This is valid with method parameters too, like, if I pass an object as a
parameter, i'll be passing a reference to the memory point where the object
is allocated, and every change made to the object in the method, will be
reflected when the method returns, again with Value Types, if I pass a value
type as a method parameter, I'm passing only the reference, in this case I
need to specify out or ref keyword in the parameter, to indicate that I want
to pass it by reference...
Few questions...
With value types, if I pass an out parameter for example, I'm passing it's
memory address to, or it works with some kind of boxing/unboxing technique
to pass these parameters? It's was just a thought, don't know if it make
sense, because I don't think that it will need to box the value type to pass
that as a reference... anyways...
I think it's that..
Thanks guys!
With reference types (objects), if I assign an object to another, the
assignment will be the address of the object, and not a copy of it's
contents right?
With value types (structs), if I assign an object to another, I'll be
copying it's data to the left side of the assignment, and not it's address.
This is valid with method parameters too, like, if I pass an object as a
parameter, i'll be passing a reference to the memory point where the object
is allocated, and every change made to the object in the method, will be
reflected when the method returns, again with Value Types, if I pass a value
type as a method parameter, I'm passing only the reference, in this case I
need to specify out or ref keyword in the parameter, to indicate that I want
to pass it by reference...
Few questions...
With value types, if I pass an out parameter for example, I'm passing it's
memory address to, or it works with some kind of boxing/unboxing technique
to pass these parameters? It's was just a thought, don't know if it make
sense, because I don't think that it will need to box the value type to pass
that as a reference... anyways...
I think it's that..
Thanks guys!