title: How to remove a struct element from a vector?
body: <p>I'm a newbie programmer and I'm working on a program that holds a registry of pets in a hotel (some silly exercise we saw in class, doesn't matter). I'm using vectors for holding the struct elements (pets). The code for the struct is this: </p>
  
  <pre><code>struct Pets{
  string Name;
  string Race;
  string Owner;
  int Tel;
  }p;
  </code></pre>
  
  <p>And the function to ask for user input is this: </p>
  
  <pre><code>AddPet(vector&lt;Pets&gt; &amp;vtnew)
  {
  Pets newpet;
  cout &lt;&lt; "Enter the pet's name: " &lt;&lt; endl;
  cin &gt;&gt; newpet.Name;
  cout &lt;&lt; "Enter the pet's race: " &lt;&lt; endl;
  cin &gt;&gt; newpet.Race;
  cout &lt;&lt; "Enter the owner's name: " &lt;&lt; endl;
  cin &gt;&gt; newpet.Owner;
  cout &lt;&lt; "Enter the owner's telephone number: " &lt;&lt; endl;
  cin &gt;&gt; newpet.Tel;
  vtnew.push_back(newpet);
  }
  </code></pre>
  
  <p>Ok, now I need to create a function to remove the pet by entering the name or something. Is there any way to do that?</p>