Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - #include <iostream>
 - #include <cstdlib>
 - using namespace std;
 - int main()
 - {
 - struct s {int x, y;char c;}; //se define una struct
 - s *matriz = new s[2];
 - for (auto y :matriz ){//uso de auto con un array de struct s
 - cin>> (y->x);
 - cin>>(y->y);
 - cin>>(y->c);
 - }
 - /*
 - for (auto y : matriz ){//uso de auto con un array de struct s
 - cout<<y->x<<" , "<<y->y<< " , "<<y->c<<endl;
 - }
 - */
 - //free(matriz);
 - delete [] matriz;
 - matriz=NULL;
 - return 0;
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment