Advertisement
AntonioVillanueva

Problema !!!!!!

Apr 8th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5. int main()
  6. {  
  7.     struct s {int x, y;char c;}; //se define una struct
  8.    
  9.     s *matriz = new s[2];
  10.  
  11.         for (auto y :matriz ){//uso de auto con un array de struct s
  12.         cin>> (y->x);
  13.         cin>>(y->y);
  14.         cin>>(y->c);   
  15.     }
  16.    
  17.     /*
  18.     for (auto y : matriz ){//uso de auto con un array de struct s
  19.         cout<<y->x<<" , "<<y->y<< " , "<<y->c<<endl;       
  20.     }
  21.     */
  22.     //free(matriz);
  23.     delete [] matriz;
  24.     matriz=NULL;
  25.     return 0;  
  26.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement