c# ushort uint16 which type to choose

4.6k Views Asked by At

I can't understand why we can have ushort and uint16… 2 bytes for both. But a problem if I want to use Convert. If I remember well it's ushort.parse(stringtype) while convert.touint16 needs an object.

I searched but can't find why… In the past I used the ushort type, but I begin to think because I need this time to convert object to ushort it's not a good idead to use ushort. I find it's a bit strange to convert to string then to convert to ushort… or to convert to uint16 then to cast to ushort. Perhaps I missed something?

It's not a crucial point but I would like to know.

0

There are 0 best solutions below