下列程序的执行结果是()
10 查阅
下列程序的执行结果是()
#include<iostream.h>;include<string.h>;classABC
{
charstr;intmax_len;public:
ABC(inti,chars);~ABC();};ABC.:ABC(inti,chars)
{max_len=i+1;str=newchar[max_len];strcpy(str,s);}
ABC.:~ABC()
{cout<<str;deletestr;}
voidmain()
{charss="Hello,C++!";ABCsd(strlen(ss),ss);cout<<"Mainend.";}
A.Mainend.
B.Hello,C++!
C.Mainend.Hello,C++!
D.Hello,C++!Mainend.
参考答案: