Does it really matter to distinct between short, int, long?

前端 未结 11 633
名媛妹妹
名媛妹妹 2021-01-17 09:46

In my C# app, I would like to know whether it is really important to use short for smaller numbers, int for bigger etc. Does the memory consumption really matter?

11条回答
  •  抹茶落季
    2021-01-17 10:47

    Only you can be the judge of whether the memory consumption really matters to you. In most situations it won't make any discernible difference.

    In general, I would recommend using int/Int32 where you can get away with it. If you really need to use short, long, byte, uint etc in a particular situation then do so.

提交回复
热议问题