语句哪里错了#includeusing namespace std;class B{public:void setpo
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/18 23:54:20
语句哪里错了
#include
using namespace std;
class B{
public:
void setpoint(int x);
int showpoint();
private:
int *point;
};
void B::setpoint(int x){*point=x;};
int B::showpoint(){return *point;};
int main(){
B a;
a.setpoint(44);
cout
#include
using namespace std;
class B{
public:
void setpoint(int x);
int showpoint();
private:
int *point;
};
void B::setpoint(int x){*point=x;};
int B::showpoint(){return *point;};
int main(){
B a;
a.setpoint(44);
cout
#include<iostream>
using namespace std;
class B{
public:
void setpoint(int x);
int showpoint();
private:
int *point;
};
void B::setpoint(int x){point=new int(x);}//开辟内存空间
int B::showpoint(){return *point;};
int main(){
B a;
a.setpoint(44);
cout<<a.showpoint();
return 0;
}
using namespace std;
class B{
public:
void setpoint(int x);
int showpoint();
private:
int *point;
};
void B::setpoint(int x){point=new int(x);}//开辟内存空间
int B::showpoint(){return *point;};
int main(){
B a;
a.setpoint(44);
cout<<a.showpoint();
return 0;
}