1 Replies - 1781 Views - Last Post: 15 June 2009 - 04:55 PM Rate Topic: -----

#1 ikofthetoids  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 39
  • Joined: 18-December 08

Converting string to hex value

Posted 15 June 2009 - 04:06 PM

I'm trying to convert a C-string with a hexadecimal value into a DWORD. here's my code:

char str[32];
str="0xFFFFFF";
DWORD hex=atoi(str);

When I run this, the atoi function only takes the 0 at the beginning of the string and not the xFFFFFF. Is there a function that can convert from a string to a hex value?
Is This A Good Question/Topic? 0
  • +

Replies To: Converting string to hex value

#2 bsaunders  Icon User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: Converting string to hex value

Posted 15 June 2009 - 04:55 PM

Have you ever used the sscanf function?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1