Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

string to decimal c++ strtol

char hex[] = "6A";                          // here is the hex string
int num = (int)strtol(hex, NULL, 16);       // number base 16
printf("%c
", num);                        // print it as a char
printf("%d
", num);                        // print it as decimal
printf("%X
", num);                        // print it back as hex
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #string #decimal #strtol
ADD COMMENT
Topic
Name
5+1 =