Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- struct s {int x, y;char c;}; //se define una struct
- s matriz[] { {1,2,'a'},{3,4,'b'},{5,6,'c'} };// y un array de structs
- for (auto y : matriz ){//uso de auto con un array de struct s
- cout<<y.x<<" , "<<y.y<< " , "<<y.c<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement