c++ - I want to convert the hex value in the character array to integer -


i want convert hex value in character array integer.

int main() {      char arr[5];     arr[0] = 0x05;     int = atoi(&arr[0]);     cout << "number = " << a; //output = 0 want here value 5   } 

you don't need conversion @ all:

int main()   char arr[5];   arr[0] = 0x05;   int = arr[0]; } 

Comments

Popular posts from this blog

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -