Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct A
- {
- char c;
- short s;
- };
- struct B
- {
- short s;
- char c;
- int i;
- };
- struct C
- {
- char c;
- double d;
- int i;
- };
- struct D
- {
- double d;
- int i;
- char c;
- };
- int main()
- {
- cout << "The sizeof A is: " << sizeof(A) << endl;
- cout << "The sizeof B is: " << sizeof(B) << endl;
- cout << "The sizeof C is: " << sizeof(C) << endl;
- cout << "The sizeof D is: " << sizeof(D) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement