以下程序的功能是:将无符号八进制数字构成的字符串转换为十进制整数。例如,输入的字符串为:556,则输出十进制整数366。请在黄色处选择合适的语句。
#include
using namespace std;
int main()
{char *p,s[6];
int n;
p=s;
cin>>p;
n=*p-'0';
while( !='\0')
n=n*8+*p-'0';
cout<
return 0;
}
A、*++p
B、*p++
C、(*p)++
D、*p
#include
using namespace std;
int main()
{char *p,s[6];
int n;
p=s;
cin>>p;
n=*p-'0';
while( !='\0')
n=n*8+*p-'0';
cout<
return 0;
}
A、*++p
B、*p++
C、(*p)++
D、*p