c++如何对结构体作为形参设置默认值

代码之下,了无疑问

#include <Windows.h>
#include <iostream>
using namespace std;

class fuck
{
private:
    RECT m_rc;
    static const RECT m_emptyRc;
public:
    fuck(RECT rc = m_emptyRc){m_rc=rc;cout<<m_rc.left<<":"<<m_rc.top<<":"<<m_rc.right<<":"<<m_rc.bottom<<endl;};
};
const RECT fuck::m_emptyRc = {1,2,3,4};
int main()
{
    fuck();
    system("pause");
    return 0;
}
posted @ 2012-07-31 14:04  likebeta  阅读(3654)  评论(1编辑  收藏  举报