<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      C++初步 2

      對象數組:

           Coordinate coord[3];  棧區           Coordinate *p=new Coordinate[3];    堆區     

      /*
       * Coordinate.h
       *
       *  Created on: 2017年7月13日
       *      Author: rmbp
       */
      
      class Coordinate
      {
      public:
          Coordinate();
          ~Coordinate();
      public:
          int m_iX;
          int m_iY;
      };
      
      /*
       * Coordinate.cpp
       *
       *  Created on: 2017年7月13日
       *      Author: rmbp
       */
      #include"Coordinate.h"
      #include<iostream>
      using namespace std;
      
      Coordinate::Coordinate()
      {
          cout<<"Coordinate"<<endl;
      }
      Coordinate::~Coordinate()
      {
          cout<<"~Coordinate"<<endl;
      }
      
      #include <iostream>
      #include <string>
      #include "Coordinate.h"
      using namespace std;
      
      int main(void)
      {
         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[i].m_iX<<endl;
             cout<<coor[i].m_iY<<endl;
         }
         for(int j=0;j<3;j++)
         {
             cout<<p->m_iX<<endl;
             cout<<p->m_iY<<endl;
             p--;
         }
      
         p++;
         delete []p;
         p=NULL;
      
         return 0;
      }
      View Code

      對象成員:

      /*
       * Coordinate.h
       *
       *  Created on: 2017年7月13日
       *      Author: rmbp
       */
      class Coordinate
      {
      public:
          Coordinate(int x,int y);
          ~Coordinate();
          void setX(int x);
          int getX();
          void setY(int y);
          int getY();
      private:
          int m_iX;
          int m_iY;
      };
      /*
       * Line.h
       *
       *  Created on: 2017年7月13日
       *      Author: rmbp
       */
      #include"Coordinate.h"
      class Line
      {
      public:
          Line(int x1,int y1,int x2,int y2);
          ~Line();
          void setA(int x,int y);
          void setB(int x,int y);
          void printInfo();
      private:
          Coordinate m_coorA;
          Coordinate m_coorB;
      };
      /*
       * Coordinate.cpp
       *
       *  Created on: 2017年7月13日
       *      Author: rmbp
       */
      #include"Coordinate.h"
      #include<iostream>
      using namespace std;
      
      Coordinate::Coordinate(int x,int y)
      {
          m_iX=x;
          m_iY=y;
          cout<<"Coordinate:"<<m_iX<<","<<m_iY<<endl;
      }
      Coordinate::~Coordinate()
      {
          cout<<"~Coordinate:"<<m_iX<<","<<m_iY<<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;
      }
      /*
       * Line.cpp
       *
       *  Created on: 2017年7月13日
       *      Author: rmbp
       */
      #include<iostream>
      #include"Line.h"
      using namespace std;
      
      Line::Line(int x1,int y1,int x2,int y2):m_coorA(x1,y1),m_coorB(x2,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<<"("<<m_coorA.getX()<<","<<m_coorA.getY()<<")"<<endl;
          cout<<"("<<m_coorB.getX()<<","<<m_coor
      主站蜘蛛池模板: 无码国内精品久久人妻蜜桃| 欧美高清精品一区二区| 欧美精品一区二区三区中文字幕| 成人免费亚洲av在线| 综合在线 亚洲 成人 欧美| 亚洲精品国产中文字幕| 日本高清一区免费中文视频| 久久久精品2019中文字幕之3| 午夜爽爽爽男女污污污网站| 国产精品国产亚洲看不卡| 成人动漫综合网| 亚洲精品漫画一二三区| 亚洲最大av资源站无码av网址| 久久国产乱子精品免费女| 在线播放国产精品三级网| 国产成人啪精品午夜网站| 国产最大的福利精品自拍| 天堂V亚洲国产V第一次| 人妻蜜臀久久av不卡| 亚洲狠狠婷婷综合久久久| 欧美黑人XXXX性高清版| 欧美人人妻人人澡人人尤物| 亚洲悠悠色综合中文字幕| 亚洲美女高潮不断亚洲| 久久精品国产亚洲av麻豆小说 | 亚洲av不卡电影在线网址最新| 国产精品人成视频免费播放| 亚洲区日韩精品中文字幕| 国产线播放免费人成视频播放| 亚洲老熟女一区二区三区| 人妻精品动漫h无码| 这里只有精品在线播放| 国产午夜伦鲁鲁| 亚洲国产无套无码av电影| 久久久这里只有精品10| 囯产精品久久久久久久久久妞妞| 日本区二区三区不卡视频| 亚洲熟妇自偷自拍另类| 人人爽人人模人人人爽人人爱| 亚洲天堂男人的天堂在线| 亚洲成年av天堂动漫网站|