built-in,, value, reference types

  • Thread starter Thread starter puzzlecracker
  • Start date Start date
P

puzzlecracker

I am sort of confused about the differences among them as I am coming
from C++

Can anyone explain how they are allocated, where are they stored,
etc?

I am also shocked that struct is value type? Can struct have member
methods?

Thanks
 
puzzlecracker said:
I am sort of confused about the differences among them as I am coming
from C++

Can anyone explain how they are allocated, where are they stored,
etc?

It's more complex than most people think. Jon Skeet has written an
informative article:
http://www.yoda.arachsys.com/csharp/memory.html
I am also shocked that struct is value type? Can struct have member
methods?

Yes, it can have member methods, properties and events. The main
limitation of structs, when compared with classes, is that you can't inherit
from them.
 
Back
Top