Char to Integer question
travis
Posts: 180
I have this two byte character array { $08, $20 }
I want to compare it with decimal 2080
( 0x820 == 2080 )
Is there a simple way ?
I want to compare it with decimal 2080
( 0x820 == 2080 )
Is there a simple way ?
0
Comments
or
c1 = $08
c2 = $20
nSum = type_cast(c1 << 8 + c2)
the << operator is the binary lshift operator. << 8 is the same as *256