填空题 函数fun的功能是将一个数字字符串转换为一个整数,请将函数补充完整。
int fun(char*str){
int num=0;
while(*str){
num*=10;
num+= 1;
str++;
}
return num;
}
【正确答案】
【答案解析】*str-"0"