angelpan1014

 

2012年7月27日

++的前置和后置

摘要: C++编译器是根据运算符函数参数表里是否插入了关键字int来区分是++是前置还是后置的,例如: 1 #include<iostream> 2 using namespace std; 3 class TDpoint 4 { 5 public: 6 TDpoint(int x=0,int y=0,int z=0) 7 { 8 this->x=x; 9 this->y=y; 10this->z=z; 11 } 12 TDpoint operator++(); 13 TDpoint operator++(int); 14 friend TDpoint operator+ 阅读全文

posted @ 2012-07-27 09:25 angelpan1014 阅读(153) 评论(0) 推荐(0) 编辑

导航