0

Possible Duplicate:
When to use struct in C#?

And conversely, when shouldn't I use either?

Community
  • 1
  • 1
Steve Dunn
  • 21,044
  • 11
  • 62
  • 87
  • Glossing over the related questions, I see half a dozen potential dupes... too much choice! –  Jan 27 '11 at 18:09
  • This might help: http://msdn.microsoft.com/en-us/library/ms173109.aspx – Skurmedel Jan 27 '11 at 18:10
  • Thanks for link. I wanted a proper discussion on the merits of each. The MS article just mentioned the words 'small', 'value', 'reference', 'complex' etc. without any quantification. I wanted to discuss performance (e.g. what's the point where you get payback for using 1 over the over where you have thousands/millions of instances) and other things. – Steve Dunn Jan 28 '11 at 06:53

1 Answers1

3

You should use a class unless you have a very specific reason to use a struct. I realize it's a little bit trite, but it's true (trite and true! hah! right?)

Adam Robinson
  • 182,639
  • 35
  • 285
  • 343