title: Why does my attempt to add to a vector within struct within a vector within a struct fail?
body: <p>I'm having this issue for a while and I would like an opinion on this. If you have any better way of doing it, please tell me. 
  Everything works well except when I try to access the vector for the items inside an entity it never executes. Always says it is empty.</p>
  
  <pre><code>struct sObj{
      char itemName[64];
      int  itemStrenght;
  };
  
  struct sEnt{
      char entityName[64];
      vector&lt;sObj&gt; entityItems;
  };
  
  class cTemp{
  public:
      void addEntity(sEnt entity){ entityList.push_back(sEnt); }
      void addItemToEnt(char* entityName, sObj itemDetails);
      void setAllItemStrenght(char* itemName, int newStr);
  private:
      vector&lt;sEnt&gt; entityList;
  };
  
  void cTemp::addItemToEnt(char* entityName, sObj itemDetails){
      for(auto m : entityList){
          if(!_stricmp(m.entityName, entityName)){
              m.entityItems.push_back(itemDetails);
              m.entityItems.push_back(itemDetails); // just for testing
              msgBox("Item count: %i", m.entityItems.size()); // is working
          }
      }
  }
  
  void cTemp::setAllItemStrenght(char* itemName, int newStr){
      for(auto m : entityList){
          msgBox("Item count: %i", m.entityItems.size()); // returns 0
          for(auto n : m.entityItems){
              // never gets executed
          }
      }
  }
  </code></pre>