When should I use a struct instead of a class?

Posted by Esteban Araya on Stack Overflow See other posts from Stack Overflow or by Esteban Araya
Published on 2008-09-17T17:20:49Z Indexed on 2010/03/26 22:03 UTC
Read the original article Hit count: 227

MSDN says that you should use structs when you need lightweight objects. Are there any other scenarios when a struct is preferable over a class?

Edit:
Some people have forgotten that:
1. structs can have methods!
2. structs have no inheritance capabilites.

Another Edit:
I understand the technical differences, I just don't have a good feel for WHEN to use a struct.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about design