单项选择题
有如下的程序:
#include <cstring.h>
#include <iostream.h>
using namespace std;
class MyString
public:
MyString(const char*s);
~MyString () delete [] data;
protected:
unsigned len;
char*data;
;
MyString::MyString(const char *s)
len=strlen (s);
data=new char[len+1];
strcpy (data,s);
int main ()
MyString a("C++ Programing");
MyString b(
A.;
return 0;
在运行上面的程
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有如下程序: #include <iostream> void fun(int& x, int y)int t=x;x=y;y=t; int main () int a[2]=23,42; fun(a[1],a[0]); std::cout<<a[0]<< , <<a[1]<<std::endl; return 0; 执行后的输出结果是
A.42,42
B.23,23
C.23,42
D.42,23
点击查看答案&解析
单项选择题
有以下程序: #include <iostream> using namespace std; int main () int x=15; while (x>10&&x<50) x++; if (x 3) x++; break; cout<<x<<endl; return 0; 执行后的输出结果是
A.15
B.16
C.17
D.18
点击查看答案&解析
相关试题
下面是一个栈类的模板,其中push函数将元素...
下列程序将x、y和z按从小到大的顺序排列,...
多数运算符既能作为类的成员函数重载,也能...
假定A为一个类,则语句A(A &a);为该类...
在下面程序的横线处填上适当的语句,使该程...