Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Cpp :: C++ array sort method 
Cpp :: prime factorisation of a number in c++ 
Cpp :: overload stream extract cpp 
Cpp :: why are inline keyword in header c++ 
Cpp :: how to convert string into lowercase in cpp 
Cpp :: setprecision c++ 
Cpp :: restting a queue stl 
Cpp :: round double to 2 decimal places c++ 
Cpp :: delete specific row from dynamic 2d array c++ 
Cpp :: C++ program that prints the prime numbers from 1 to 1000. 
Cpp :: read and write file in c++ 
Cpp :: functors in c++ 
Cpp :: c++ vectors 
Cpp :: Count Prefix of a Given String solution leetcode 
Cpp :: C++ Vector Iterator Syntax 
Cpp :: stringstream stream number to string 
Cpp :: sort vector struct c++ 
Cpp :: c++ int to char* 
Cpp :: reverse level order traversal 
Cpp :: cpp when use size_t 
Cpp :: string split by space c++ 
Cpp :: cpp func as const 
Cpp :: c++ cout without include iostream 
Cpp :: how to initialize vector 
Cpp :: macros in c++ 
Cpp :: quick sort 
Cpp :: cin exceptions c++ 
Cpp :: array of Methods c++ 
Cpp :: c++ set swap 
Cpp :: how to make a function in c++ 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =