pabloliva87

Ej3C++

Feb 1st, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. struct Pepe {
  7.     int x;
  8.     int y;
  9.     int z;
  10. };
  11.  
  12. struct Juan {
  13.     Pepe& pp;
  14.     int a;
  15. };
  16.  
  17. typedef struct Pepe Pepe;
  18. typedef struct Juan Juan;
  19.  
  20. int main (void) {
  21.  
  22.     Pepe joe;
  23.    
  24.     joe.x = 0;
  25.     joe.y = 1;
  26.     joe.z = 2;
  27.    
  28.     Juan johnny = {joe,18};
  29.    
  30.     cout << "Pepe: " << sizeof(joe) << endl << "Juan: " << sizeof(johnny) << endl << "Int: " << sizeof(int) << endl;
  31.    
  32.     return EXIT_SUCCESS;
  33. }
Add Comment
Please, Sign In to add comment