I have a char[] that contains a value such as \"0x1800785\" but the function I want to give the value to requires an int, how can I convert this to an int? I have searched a
Use xtoi ( stdlib.h ). The string has "0x" as first two indexes so trim val[0] and val[1] off by sending xtoi &val[2].
xtoi( &val[2] );