0

I have a situation where I have a char *, called number, which will either contain a decimal number in the form of ("123") or a hexadecimal number in the form ("0x123"), where 123 is arbitrary;

What is the best way to convert this string to an integer considering I don't know which format the char * will be in?

NathanOliver
  • 171,901
  • 28
  • 288
  • 402
dilan_s
  • 129
  • 1
  • 10

0 Answers0