Literal suffix for byte in .NET?

后端 未结 4 1436
生来不讨喜
生来不讨喜 2020-12-28 11:38

I am wondering if there is any way to declare a byte variable in a short way like floats or doubles? I mean like 5f and 5d. Sure I could write

4条回答
  •  悲哀的现实
    2020-12-28 12:01

    From this MSDN page, it would seem that your only options are to cast explicitly (var x = (byte)5), or stop using var...

提交回复
热议问题