In C# can casting a Char to Int32 produce a negative value?

后端 未结 5 917
时光取名叫无心
时光取名叫无心 2021-01-18 11:03

Or is it always guaranteed to be positive for all possible Chars?

5条回答
  •  难免孤独
    2021-01-18 11:51

    Since the range of char is U+0000 to U+ffff, then a cast to an Int32 will always be positive.

提交回复
热议问题