hi,
why does the following produce an output of 64769 instead of 1
int main()
{
bool* pBool = new bool(false);
unsigned short* pUS = (unsigned short*)pBool;
cout << *pUS;
delete pBool;
return 0;
}
I expected the output to be 1 since the size of a bool and the size of
an unsigned int is 1
why does the following produce an output of 64769 instead of 1
int main()
{
bool* pBool = new bool(false);
unsigned short* pUS = (unsigned short*)pBool;
cout << *pUS;
delete pBool;
return 0;
}
I expected the output to be 1 since the size of a bool and the size of
an unsigned int is 1
Comment