Escolar Documentos
Profissional Documentos
Cultura Documentos
: : 15.03.2011 .
char *(X[64]); cout << sizeof(&X) << endl;
, 4 Win32 , .
char *(X[64]); memset(&X, 0, sizeof(& X));
? , , : 8 Win64
" .
".
. .
X.
VS 2005 ,
, VS 2005 SP1.
"sizeof(&X)" . .
, Framework:
class TestForSP1 {
private: // GCC complains if x_ is used by sizeof before defining it. static char x_[100]; // VS 2005 RTM incorrectly reports sizeof(&x) as 100, and that value
// is used to trigger 'invalid negative array size' error. If you // see this error, upgrade to VS 2005 SP1 since Google Mock will not // compile in VS 2005 RTM. static char
"&X". . :
memset(&X, 0, sizeof(X)); memset(X, 0, sizeof(X));
, sizeof(X) . .
sizeof(&X)