m烦这段c语言代码是什么意思

#include
#include
#include
#define N 9
long ctod( char *s )
{ long d=0;
while(*s)
if(isdigit( s)) {
d=d
10+*s-‘0’
s++;}
return d;
}
long fun( char *a, char *b )
{
return ctod(a)+ctod(b)
}
main()
{ char s1[N],s2[N];
do
{ printf("Input string s1 : "); gets(s1); }
while( strlen(s1)>N );
do
{ printf("Input string s2 : "); gets(s2); }
while( strlen(s2)>N );
printf("The result is: %ld\n", fun(s1,s2) );
}

返回两个字符串中包含所有数字的累加和

这串代码实现的是 将你定义的两个字符数组输入数字字符,最后输出的是两个字符数组的数字字符分别转换为数字然后相加,但我觉得do while循环终止表达式条件应该是strlen(s1>=N)因为如果是>N你输入的是9个数字字符按回车结果循环会结束,但是数组会发生越界访问。。