M
Marcel Hug
Hi Ng !
At first I would like to thank you about the very good answers on my C#
Fundamental question one.
Now I have a new question. It's about structs.
So I've read that the different between a class and a strct is that a
class is an reference type and a struct a value type.
For me that means, that the CLR places the data of a struct on the stack
and not on the heapo like for a class.
But what does happen, if I create a struct that has data members of a
reference type ? I guess that the variable (data member) of this
reference type is just holding a pointer, which points on the heap !
It's that right ? Is it recommendet to use reference types in structs ?
Thanks for helping me to improve my understanding !
Regards
Marcel Hug
At first I would like to thank you about the very good answers on my C#
Fundamental question one.
Now I have a new question. It's about structs.
So I've read that the different between a class and a strct is that a
class is an reference type and a struct a value type.
For me that means, that the CLR places the data of a struct on the stack
and not on the heapo like for a class.
But what does happen, if I create a struct that has data members of a
reference type ? I guess that the variable (data member) of this
reference type is just holding a pointer, which points on the heap !
It's that right ? Is it recommendet to use reference types in structs ?
Thanks for helping me to improve my understanding !
Regards
Marcel Hug