2/26/2013

string hex to decimal


#include < stdlib.h >
#include < stdio.h >

void main()
{
char s[]="17D";
unsigned long x;
x = strtoul(s, 0, 16);
printf("%d\n", x);

}

No comments:

Post a Comment