int 型数据的范围:-2^31~2^31-1(-2147483648~2147483647)
unsigned int: 0~2^32
1.自己写的函数,注意特殊情况的考虑(c代码,基于char*类型)
#include <iostream> using namespace std; #include <climits> //包含整型数的范围限制 int myAtoi(char* str) { unsigned long int number=0; bool ifneg=false; if(str=='