picec of code
来源:互联网 发布:上海艾诺科软件 编辑:程序博客网 时间:2024/06/05 07:03
#include <iostream>
using namespace std;
class INT{
public:
friend ostream& operator<<(ostream& os, const INT& i);
INT(int i): m_i(i){}
INT& operator++(){
++(this->m_i);
return *this;
}
const INT operator++(int){
INT tmp = *this;
++(*this);
return tmp;
}
INT& operator--(){
--(this->m_i);
return *this;
}
const INT operator--(int){
INT tmp = *this;
--(*this);
return tmp;
}
int& operator*(){
return (int&)m_i;
}
private:
int m_i;
};
ostream& operator<< (ostream& os, const INT& i)
{
os << '[' << i.m_i << ']' << endl;
return os;
}
int main()
{
INT I(5);
cout << I++ << endl;
cout << ++I << endl;
cout << I-- << endl;
cout << --I << endl;
cout << *(I) << endl;
return 0;
}
using namespace std;
class INT{
public:
friend ostream& operator<<(ostream& os, const INT& i);
INT(int i): m_i(i){}
INT& operator++(){
++(this->m_i);
return *this;
}
const INT operator++(int){
INT tmp = *this;
++(*this);
return tmp;
}
INT& operator--(){
--(this->m_i);
return *this;
}
const INT operator--(int){
INT tmp = *this;
--(*this);
return tmp;
}
int& operator*(){
return (int&)m_i;
}
private:
int m_i;
};
ostream& operator<< (ostream& os, const INT& i)
{
os << '[' << i.m_i << ']' << endl;
return os;
}
int main()
{
INT I(5);
cout << I++ << endl;
cout << ++I << endl;
cout << I-- << endl;
cout << --I << endl;
cout << *(I) << endl;
return 0;
}
- picec of code
- Source Code of exe2com.
- Source Code of exe2com
- Source code of CIH
- IGFEL CODE OF CONDUCT
- a clump of code
- another clump of code
- test of code
- the code of love
- Study of Source code
- sample code of webview
- Source code of ZMRP_VSS_CLEANUP
- Code interview of Amazon
- piece of code(2)
- piece of code(3)
- code of ptrace
- piece of code(4)
- piece of code stl
- C++著名库的比较和学习经验
- shell脚本---tr的使用
- Win7下启用Telnet方法
- Socket网络编程(备忘)
- 驱动中区分 win8 的 fast startup 与普通的 cold startup
- picec of code
- cookies和session的概念
- 关于 set_new_handler的总结
- C#调用汇编dll
- C语言插件机制(上) -- linux动态库
- 解决msys和MinGW中文乱码以及输入中文问题
- shell@android: 怎么切到root
- linux字符设备文件的打开操作
- 走在CentOS的路上(持续更新)