Advertisement
obernardovieira

Multi-Struct allocate values (testing)

Jun 18th, 2014
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. struct info {
  2.  
  3.     struct {
  4.         int rodas;
  5.         int motor;
  6.     } lecarro;
  7.  
  8.     struct {
  9.         int guiador;
  10.         int volante;
  11.     } lemota;
  12.  
  13.     struct {
  14.         int limite;
  15.         int voo;
  16.     } leaviao;
  17.  
  18. };
  19.  
  20. #include <map>
  21.  
  22.  
  23. void funcao() {
  24.     std::map < int, struct info> MyInfo;
  25.     info Info;
  26.  
  27.     MyInfo[5] = Info;
  28.  
  29.     MyInfo[5].lecarro.motor = 5;
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement