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

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

為什么老提示錯誤?

#include<iostream>

#include"Line.h"

using namespace std;


Line::Line(int x1,int y1,int x2,int y2)

{

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<<"printInfo()"<<endl;

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

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

}

void Line::printInfo() const

{

cout<<"printInfo() const"<<endl;

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

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

}

error C2512: “Coordinate”: 沒有合適的默認(rèn)構(gòu)造函數(shù)可用

正在回答

2 回答

你的坐標(biāo)類都沒有定義,也就找不到Coordinate對象也就是找不到構(gòu)造函數(shù)實例化Coordinate。 ??m_coorA.getX()這個m_coorA是一個對象成員

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

慕田峪7021683

沒搞懂
2016-06-03 回復(fù) 有任何疑惑可以回復(fù)我~

你是不是在調(diào)用的時候調(diào)用的是Coordinate這個類的默認(rèn)構(gòu)造函數(shù)?而在Coordinate這類中你把默認(rèn)構(gòu)造函數(shù)給覆蓋了?

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

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

封裝--面向?qū)ο笕筇卣髦?,通過案例讓C++所學(xué)知識融會貫通

進入課程

為什么老提示錯誤?

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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