Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-213
strtol
Example
This example prints “138051”, which is the decimal equivalent of the hexadecimal
number 21B43:
#include <stdlibh>
#include <stdioh>
int main(void)
{
char *string;
char *end_of_num;
long num;
string = "21B43";
num = strtol(string, &end_of_num, 16);
printf("%ld",num);
}