函数名: strtol
功 能: 将串转换为长整数
用 法: #include <stdlib.h>
long strtol(char *str, char **endptr, int base);
程序例:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
char *string = "87654321", *endptr;
long lnumber;
/* strtol converts string to long integer */
lnumber = strtol(string, &endptr, 10);
printf("string = %s long = %ld\n", string, lnumber);
return 0;
}