标签:
例如:将字符串型“158”转换成整型158
int String2Int(char * buff) { int value = 0; int index = 0; for(;buff[index] >= ‘0‘ && buff[index] <=‘9‘; index++) { value = value * 10 + buff[index] - ‘0‘; } return value; }
标签:
原文地址:http://www.cnblogs.com/youthshouting/p/4381386.html