C++程序运行出错,有好多乱码“葺葺葺葺葺葺葺葺?”,求救~#include #include class MyString{public:\x05MyString()\x05{\x05\x05str=0;\x05}\x05MyString(const char* rhs)\x05{\x05\x05str=new char[strlen(rhs)+1];\x05\x05for(int i=0;istr);

来源:学生作业帮助网 编辑:作业帮 时间:2024/10/04 19:49:34
C++程序运行出错,有好多乱码“葺葺葺葺葺葺葺葺?”,求救~#include #include class MyString{public:\x05MyString()\x05{\x05\x05str=0;\x05}\x05MyString(const char* rhs)\x05{\x05\x05str=new char[strlen(rhs)+1];\x05\x05for(int i=0;istr);
xS?K@*g]*4..N&=pP."ZRAAw&\bƴNnBry߽;#'\xtNS9|_֡so;wWvf򚝡G:݋8²j*D@V% ; nfEErie8q<,נd(0TKd Ud! eP!)7*9kX!?FևT4߹8NԲ"jɟ"4*qD~:D9}4@jo&J8 YU([mJц0n,0ܬM )`CB

C++程序运行出错,有好多乱码“葺葺葺葺葺葺葺葺?”,求救~#include #include class MyString{public:\x05MyString()\x05{\x05\x05str=0;\x05}\x05MyString(const char* rhs)\x05{\x05\x05str=new char[strlen(rhs)+1];\x05\x05for(int i=0;istr);
C++程序运行出错,有好多乱码“葺葺葺葺葺葺葺葺?”,求救~
#include
#include
class MyString
{
public:
\x05MyString()
\x05{
\x05\x05str=0;
\x05}
\x05MyString(const char* rhs)
\x05{
\x05\x05str=new char[strlen(rhs)+1];
\x05\x05for(int i=0;istr);
\x05\x05strcat(pchar,rhs.str);
\x05\x05return MyString(pchar);
\x05}
\x05MyString::MyString()
\x05{
\x05\x05delete[] str;
\x05}
private:
\x05char* str;
\x05MyString* pMyString;
};
void main( ) {
\x05MyString s1("Hello ");\x05
\x05MyString s2("World!");
\x05cout

C++程序运行出错,有好多乱码“葺葺葺葺葺葺葺葺?”,求救~#include #include class MyString{public:\x05MyString()\x05{\x05\x05str=0;\x05}\x05MyString(const char* rhs)\x05{\x05\x05str=new char[strlen(rhs)+1];\x05\x05for(int i=0;istr);
你没有重载赋值操作符.