D
dengminli
Unregistered / Unconfirmed
GUEST, unregistred user!
为string类定义一个类转换函数:
string:perator const char *( );
以保证下面的程序能正确运行:
if (strcmp(ob1,ob2)= =0)
cout<<ob1<<” is equal to “<<ob2<<endl;
else
cout<<ob1<<” is not equal to “<<ob2<<endl;
其中ob1和ob2是string类的对象。
string:perator const char *( );
以保证下面的程序能正确运行:
if (strcmp(ob1,ob2)= =0)
cout<<ob1<<” is equal to “<<ob2<<endl;
else
cout<<ob1<<” is not equal to “<<ob2<<endl;
其中ob1和ob2是string类的对象。