Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct A
- {
- int x, y, z;
- };
- struct B
- {
- A l, u;
- };
- struct C
- {
- B t, f;
- };
- // sizeof(A) == 3*sizeof(int)
- // sizeof(B) == 6*sizeof(int)
- // sizeof(C) == 12*sizeof(int)
- // foo() does not copy a. Should b be passed by value or by reference?
- void foo(A a);
- void foo(A const& a);
- // bar() does not copy b. Should b be passed by value or by reference?
- void bar(A a);
- void bar(A const& a);
- // buzz() does not copy c. Should c be passed by value or by reference?
- void buzz(A c);
- void buzz(A const& c);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement