What does "S" mean in hexadecimal number?

Trying to convert some vb.net code to C #, I came across this:

Dim b As Byte = &HCS

The actual value of this parameter is equal to &H0Cor 12 decimal places. What does the inclusion of the "S" character do in this context?

+4
source share
1 answer

This is the so-called Type Character. It is used as a short hand to declare constant values ​​of a particular type. In your case, Sturns the value &HCinto Short(Int16).

Usually they are used in this way when you do not specify the type of the variable in the form As [type]:

Dim number = 56L 'This makes 'number' a variable of type Long.

Byte , , - a Short.

: (Visual Basic) | Microsoft

+2

Source: https://habr.com/ru/post/1690864/


All Articles