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
Write a program to print factorial of given number using recursion?
Can stdout be forced to print somewhere other than the screen?
What is exit() function?
How do you construct an increment statement or decrement statement in C?
What are the primitive data types in c?
What is function and its example?
Is the exit() function same as the return statement? Explain.
How can I find the modification date and time of a file?
How can I discover how many arguments a function was actually called with?
Explain union.
How can I call a function with an argument list built up at run time?
How is a pointer variable declared?
Why enum is used in c?
Do variables need to be initialized?
What is a pointer and how it is initialized?