title: reading from a file lines and numbers in c++
body: <p>I'm new in c++ and I'm practicing how to read from a file a string line one and then a number then a string line two.</p>
  
  <p>example string </p>
  
  <pre><code>line one, number, string line two.
  </code></pre>
  
  <p>can someone help me to create a while loop, I know how to open a file. just need help reading a line of strings follow by reading in a number and a string line again.</p>
  
  <pre><code>while (?? file &gt;&gt; strline) {
     cout &lt;&lt; strline;
     cout &lt;&lt; number;
     cout &lt;&lt; strline;
  }
  </code></pre>
  
  <p>Any suggestions on how to tackle this? thanks in advance.</p>