摘要: #include"iostream.h"class Counter{private:int v;public:Counter(){}Counter(int v){this->v=v;}Counter operator ++(){v++;也可写为: ++v; return *this; return v;}Counter operator ++(int){Counter t;t.v=v++;return t;}void disp(){cout<<v<<endl;}};void main(){Counter c1(3),c2(3),c;c=c1++ 阅读全文
posted @ 2011-12-13 21:59 奇奇博客 阅读(146) 评论(0) 推荐(0)