struct - what is it for?

前端 未结 10 2382
小鲜肉
小鲜肉 2020-12-17 23:42

I know something about struct type. But I can\'t understand: what is it for? when have I use it? Classes, simple value-types and enums - that\'s all that I need

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-18 00:04

    If you don't know why you need it, you probably don't.

    struct is a value type rather than a reference type. If you don't know what that means, then you probably aren't going to need it.

提交回复
热议问题