其函数原型如下:
unsigned long strtoul( const char *nptr, char **endptr, int base )
参数1:字符串起始地址
参数2:返回字符串有效数字的结束地址,这也是为什么要用二级指针的原因。
参数3:转换基数。当base=0,自动判断字符串的类型,并按10进制输出,例如"0xa",就会把字符串当做16进制处理,输出的为10。更多的下面详细阐述。
unsigned long strtoul( const char *nptr, char **endptr, int base )
参数1:字符串起始地址
参数2:返回字符串有效数字的结束地址,这也是为什么要用二级指针的原因。
参数3:转换基数。当base=0,自动判断字符串的类型,并按10进制输出,例如"0xa",就会把字符串当做16进制处理,输出的为10。更多的下面详细阐述。
贴上函数原型
- include "stdafx.h"
- #include <iostream>
- #include <stdlib.h>
- using