单项选择题
有下列的程序:
#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> using namespace std; class Complex double re,im; public: Complex(double r,double i):re(r),im(i) double real()constreturn re; double image()constreturn im; Complex& operator+=(Complex
A.
&
点击查看答案&解析
单项选择题
已知在函数func()中语句this->ff=0;与语句ff=0;的效果完全相同。对于这一现象,下列表述中错误的是( )。
A.ff是某个类的数据成员,func()是该类的友元函数
B.ff是某个类的数据成员,func()是该类的成员函数
C.this->ff和ff是同一个变量
D.func不是一个静态成员函数
点击查看答案&解析
相关试题
下列程序的执行结果是( )。 #include...
下列程序的输出结果是( )。 #include...
有如下程序: #include<iostream.h> ...