Practical differences between classes and structs in .net (not conceptual)?
Posted
by Gulshan
on Stack Overflow
See other posts from Stack Overflow
or by Gulshan
Published on 2010-05-01T13:21:50Z
Indexed on
2010/05/01
13:27 UTC
Read the original article
Hit count: 358
Whenever I tried to search about differences between classes and structs in C# or .net, I ended up with the conceptual overview of the two things like value type or the reference type, where the variables are allocated etc. But I need some practical differences. I have found some like different behavior of assignment operator, having constructors etc. Can anybody provide some more practical differences which will be directly useful while coding? Like the things works with one but not with other or same operation showing different behavior. And some common mistakes regarding these two.
Also please suggest where to consider using a struct instead of a class. And where the structs should not be used.
© Stack Overflow or respective owner