第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

哪位高人幫忙 看下錯不哪了

#include<stdlib.h>

#include<iostream>


using namespace std;

class Coordinate

{

public:

? Coordinate();

? ~Coordinate();

? void setX(int x);

? int getX();

? void setY(int y);

? int getY();

?private:

? int m_iX;

? int m_iY;

};

Coordinate::Coordinate()

{

cout<<"Coordinate"<<endl;

}

Coordinate::~Coordinate()

{

cout<<"~Coordinate"<<endl;

}

void Coordinate::setX(int x)

{

m_iX=x;

}

int Coordinate::getX()

{

return m_iX;

}

void Coordinate::setY(int y)

{

m_iY=y;

}

int Coordinate::getY()

{

return m_iY;

}

class Line

{

public:

Line();

~Line();

void setA(int x,int y);

void setB(int x,int y);

void printInfo();

private:

Coordinate m_coorA;

Coordinate m_coorB;

};

Line::Line()

{

cout<<"Line"<<endl;

}

Line::~Line()

{

cout<<"~Line"<<endl;

}

void Line::setA(int x,int y)

{

m_coorA.setX(x);

m_coorA.setY(y);

}

void Line::setB(int x,int y)

{

m_coorB.setX(x);

m_coorB.setY(y);

}

void Line::printInfo()

{

cout<<"("<<m_coorA.getX()<<","<<m_coorA.getY()<<")"<<endl;

cout<<"("<<m_coorB.getX()<<","<<m_coorB.getY()<<")"<<endl;

}

int main(void)

{

Line*p=new Line();

delete p;

p=NULL;

system("pause");

return 0;

}


正在回答

1 回答

Line*p=new?Line();

這里需要有空格吧,如下

Line?*p=new?Line();


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
C++遠征之封裝篇(下)
  • 參與學習       70903    人
  • 解答問題       533    個

封裝--面向?qū)ο笕筇卣髦唬ㄟ^案例讓C++所學知識融會貫通

進入課程

哪位高人幫忙 看下錯不哪了

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號