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

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

我的運行結(jié)果(下圖)和老師的運行結(jié)果(上圖)不一樣是什么原因?我用的編譯器是visual c++6.0 下面有代碼

http://img1.sycdn.imooc.com//55bdc15f000166ed04700303.jpghttp://img1.sycdn.imooc.com//55bdc1a30001288506710433.jpg

#include "iostream"

#include"stdlib.h"

#include "string "

using namespace std ;

class coordinate

{

public:

coordinate();

~coordinate();


public:

int m_iX;

int m_iY;

};

coordinate::coordinate()

{

cout<<"coordiante"<<endl;


}

coordinate::~coordinate()

{

cout<<"~coordinate"<<endl;


}





int main()

{

? ?coordinate coor[3];

? ?coor[0].m_iX=3;

? ?coor[0].m_iY=5;



? ?coordinate * P=new coordinate[3];

? ?P->m_iX=7;

? ?P[0].m_iY=9;

? ?P++;

? ?P->m_iX=11;

? ?P[0].m_iY=13; ? ?

? ?P[1].m_iX=15;

? ?P++;

? ?P->m_iY=17;


? ?for(int i=0;i<3;i++)

? ?{

? cout<<"coor.x"<<coor[i].m_iX<<endl;

? ?} ? cout<<"coor.y"<<coor[i].m_iY<<endl;

? ?for(int j=0;j<3;j++)

? ?{

? cout<<"p_x"<<P->m_iX<<endl;

? cout<<"p_y"<<P->m_iY<<endl;

? P--;

? ?}

? ?P++;

? ?delete []P; ?

? ?P=NULL;



system("pause");

return 0;

}


正在回答

2 回答

程序是如何運行的呢

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

已經(jīng)解決了

?for(int i=0;i<3;i++)

? ?{

? cout<<"coor.x"<<coor[i].m_iX<<endl;

? ?} ? cout<<"coor.y"<<coor[i].m_iY<<endl; ?//這行寫到括號外面了,寫到里面就對了


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

舉報

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

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

進入課程

我的運行結(jié)果(下圖)和老師的運行結(jié)果(上圖)不一樣是什么原因?我用的編譯器是visual c++6.0 下面有代碼

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

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

幫助反饋 APP下載

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

公眾號

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