ios - How to convert char(or Byte) with hexadecimal data in it, to an integer(decimal value) -


i have

char tem; 

its value shown blow:

printing description of tem: (char) tem = '\xd1' 

which should equals 209 in decimal.

my question how can implement conversion programmatically? want nsinteger equals 209 in case.

maybe there’s i’m overlooking here, given both char , nsinteger integral types, can’t do

char tem = '\xd1'; nsinteger = tem; 

? or perhaps, avoid surprises sign extension,

nsinteger = tem & 0xff; 

Comments

Popular posts from this blog

Prolog - Listing -

linear regression - Trying to get confidence/prediction intervals with `predict.lm` in R, but I keep getting an error regarding my dichotomous variable -

python - More Issues with overlapping labels in Tkinter -