Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. class A {
  4. public:
  5. int a;
  6. };
  7.  
  8. class B : public A {
  9. public:
  10. int b;
  11. };
  12.  
  13. void go(A b[2]) {
  14. fprintf(stderr, "%d %d\n", b[0].a, b[1].a);
  15. }
  16.  
  17. int main() {
  18. B bs[2];
  19. bs[0].a = 1;
  20. bs[0].b = 2;
  21. bs[1].a = 3;
  22. bs[1].b = 4;
  23. go(bs);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement