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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top