填空题

函数fun的功能是将一个数字字符串转换为一个整数,请将函数补充完整。
int fun(char*str)
int hum=0;
while(*str)
num*=10;
num+=______
str++;
return num;

【参考答案】

(*str-’0’)