B
bintom
class MyClass
{ int i;
char ch;
};
int main()
{ cout << sizeof(MyClass); }
Under Turbo C++, the above code gives sizeof 'MyClass' as 2 + 1 = 3
bytes.
But under Dev C++ and MS VC++, whereas it should give 4 + 1 = 5 bytes,
it is showing 8 bytes. Why?
Thanks in advance,
Binoy Thomas
{ int i;
char ch;
};
int main()
{ cout << sizeof(MyClass); }
Under Turbo C++, the above code gives sizeof 'MyClass' as 2 + 1 = 3
bytes.
But under Dev C++ and MS VC++, whereas it should give 4 + 1 = 5 bytes,
it is showing 8 bytes. Why?
Thanks in advance,
Binoy Thomas