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
  • 161,918
  • 27
  • 262
  • 366
dilan_s
  • 91
  • 1
  • 8

0 Answers0