语句哪里错了#includeusing 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

来源:学生作业帮助网 编辑:作业帮 时间:2022/08/13 02:56:03
语句哪里错了#includeusing 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

语句哪里错了#includeusing 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

语句哪里错了#includeusing 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;
}