title: time format hh:mm:ss input
body: <p>I am in a case when i am given two time formats hh:mm:ss to input.</p>
  
  <p>I know that <code>int</code> variables exctract from <code>cin</code> until a non-integer is reached. This means that i can extract the hours easily, but then the character ":" would still be in the stream, which would cause a problem for the extraction of minutes.</p>
  
  <p>I know i can use <code>cin.ignore()</code> but since i have to input two time formats, the code just for the input would result very long and not seem too good.</p>
  
  <p>Just to give you an idea:</p>
  
  <pre><code>int h,m,s, h2,m2,s2;
  cin&gt;&gt;h;
  cin.ignore();
  cin&gt;&gt;m;
  cin.ignore();
  cin&gt;&gt;s;
  cin&gt;&gt;h2;
  cin.ignore();
  cin&gt;&gt;m2;
  cin.ignore();
  cin&gt;&gt;s2;
  </code></pre>
  
  <p>I know that cin automatically ignores whitespaces. Is there a way to make it <strong>automatically</strong> ignore a specific character (in this case, the character ":")?</p>