赞
踩
testbigsmall.cpp
#include <iostream>
using namespace std;
bool bigCheck()
{
union Check
{
char a;
int data;
};
Check c;
c.data = 1;
if (1 == c.a)
{
return false;
}
return true;
}
int main()
{
if (bigCheck())
{
cout << "big" << endl;
}
else
{
cout << "small" << endl;
}
return 0;
}
$ g++ testbigsmall.cpp -o testbigsmall
/usr/include/c++/4.4.7/bits/stringfwd.h:42: error: expected constructor, destructor, or type conversion before ‘(’ tokenCopyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。