avr39-ripe

Bot struct and Array

Oct 30th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. struct Bot
  2. {
  3.     int cordX;
  4.     int cordY;
  5.     int health;
  6.     int type
  7. };
  8.  
  9. Bot bots[3]{{0,0,100,10},{10,20,50,5},{5,7,10,1}};
  10.  
  11. cout << bots[0].coordX << '\n'; // 0
  12. cout << bots[0].coordY << '\n'; // 0
  13. cout << bots[0].health << '\n'; // 100
  14. cout << bots[0].type << '\n'; // 10
Advertisement
Add Comment
Please, Sign In to add comment