开发者

In C#, when should I use a struct and when should I use a class? [duplicate]

开发者 https://www.devze.com 2023-02-07 16:11 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: When to use struct in C#?
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

When to use struct in C#?

And conversely, when shouldn't I u开发者_运维技巧se either?


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?)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号