class Coordinate
{
public:
Coordinate(int x, int y)
{
m_iX=x;
m_iY=u;
}
void printInfo() const
{
cout<<"("<<x<<","<<y<<")"<<endl;
}
public:
int m_iX;
int m_iY;
};
int main(void)
{
const Coordinate coor(3, 5);
const int *p
int * const p;
coor.printInfo();
p->printInfo();
c.printInfo();
return 0;
}
{
public:
Coordinate(int x, int y)
{
m_iX=x;
m_iY=u;
}
void printInfo() const
{
cout<<"("<<x<<","<<y<<")"<<endl;
}
public:
int m_iX;
int m_iY;
};
int main(void)
{
const Coordinate coor(3, 5);
const int *p
int * const p;
coor.printInfo();
p->printInfo();
c.printInfo();
return 0;
}
我个人整理编写的整个封装篇的学习内容代码及重点:
http://www.jianshu.com/p/3acad8a9efd1
整个博客里详细记录了整个远征计划几千字的笔记。希望可以帮到要学c++的同学。
远征计划地址: http://www.imooc.com/course/programdetail/pid/42
求赞
http://www.jianshu.com/p/3acad8a9efd1
整个博客里详细记录了整个远征计划几千字的笔记。希望可以帮到要学c++的同学。
远征计划地址: http://www.imooc.com/course/programdetail/pid/42
求赞
2017-09-01