fgo美狄亚lily立绘:帮我看看这段C++代码到底错在哪里呀?

来源:百度文库 编辑:高考问答 时间:2024/05/09 18:04:06
可以正常编译、运行,就是运行后出问题,有错误提示,看不懂。
我晕,忘了发了!
#include <iostream>
#include <string>
using namespace std;
class Student
{
private:
string name;
long id;
public:
Student();
Student(string,long);
Student(Student&);
~Student();
void show();
void set(string,long);
};
Student::Student()
{
name="no";
id=0;
}
Student::Student(string nam,long i)
{
name=nam;
id=i;
}
~Student()
{
cout<<"Programed by Shoru\0";
}
void Student::show()
{
cout<<"Name is:"<<name<<endl;
cout<<"ID is:"<<id<<endl;
}
void Student::set(string nam,long i)
{
name=nam;
id=i;
}
Student Student::Student(&Student st)
{
st.name="LL";
st.id=002;
return st;
}
//------------------------------------------------------------------------
int main()
{

Student stu0,stu1("shoru",5);
string str1="shoru";
stu0.show();
stu1.show();
delete &stu0;
Student *stu0;
stu0=

return 0;
}
请运行一下看看哦~

把你的代码发出来呀!