下列程序输出的是( )。
string ch="hello";
if(ch[5]==NULL)
{
cout<<"right"<<endl;
}
else if (ch[5]=='\0')
{
cout<<"wrong"<<endl;
}
else
{
cout<<"hello"<<endl;
}
- A.
right - B.
wrong - C.
hello - D. 不能正确执行
g3-03607.in输出g3-03607.out下列程序输出的是( )。
string ch="hello";
if(ch[5]==NULL)
{
cout<<"right"<<endl;
}
else if (ch[5]=='\0')
{
cout<<"wrong"<<endl;
}
else
{
cout<<"hello"<<endl;
}
rightwronghello