case LEN_STATUS:
{
if (buf[i] == ‘:’)
{
/* 计算长度 */
for (m = 0; m < i; m++)
{
len = len * 10 + buf[m] - ‘0’;
}
status = DATA_STATUS;
i = 0;
}
else
{
i++;
}
break;
}
那就考考你吧
字符串“123”,你要怎样做才能把它换算成整数123?
1 个赞