#include <iostream.h>
main() {
struct one {
char a;
int b;
float c;
};
struct one o;
cout << "O is " <<
sizeof(o) << " bytes large\n";
cout << "O starts
at " << (unsigned int)&(o) << endl;
cout << "o.a starts
at " << (unsigned int)&(o.a) << endl;
cout << "o.a is "
<< sizeof(o.a) << " bytes large\n";
cout << "o.b starts
at " << (unsigned int)&(o.b) << endl;
cout << "o.b is "
<< sizeof(o.b) << " bytes large\n";
cout << "o.c starts
at " << (unsigned int)&(o.c) << endl;
cout << "o.c is "
<< sizeof(o.c) << " bytes large\n";
} |