Write code for atoi(x) where x is hexadecimal string.
Answer Posted / audrius
long l = strtol(string, NULL, 16);
//or, if you need unsigned (which you usually do with hexes)
unsigned long ul = strtoul(string, NULL, 16);
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
When the macros gets expanded?
Can we change the value of static variable in c?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What is wrong with this initialization?
What is the use of sizeof?
Why is void main used?
What is scope and lifetime of a variable in c?
Explain bitwise shift operators?
What is a macro, and explain how do you use it?
How can I pad a string to a known length?
What is sorting in c plus plus?
How many types of errors are there in c language? Explain
What are the __date__ and __time__ preprocessor commands?
Why does this code crash?