现在的位置: 首页 > 综合 > 正文

变态的C++

2013年08月03日 ⁄ 综合 ⁄ 共 393字 ⁄ 字号 评论关闭

无意中在网上看到一段程序,感觉比较变态。

 

#include "stdafx.h"
#include <iostream> 

#include <vector> 

typedef int UINT4; 

using namespace std; 

class Hack 


 int m_a;
 int m_b;

};

Hack& operator< (Hack &a , Hack &b) 

 std::cerr << "小于操作符/n"; 

 return a; 

}

Hack& operator> (Hack &a, Hack &b) 

 std::cerr <<  "大于操作符/n"; 

 return a; 

int _tmain(int argc, _TCHAR* argv[])
{
 Hack vector;
 Hack UINT4;
 Hack foo;

 vector<UINT4> foo;

 system("pause");

 return 0;
}

输出结果 看看吧。

抱歉!评论已关闭.