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

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

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -