title: How to read a paragraph from file as a single string in c++
body: <p>I m writing a c++ program that should read a file. If that file contains a set of sentences, say a paragraph, how would i make it to read the entire paragraph as a single string?
  when i tried coding this, my program could read only the first word, and it stops when it sees the <strong>space</strong> sequence. </p>
  
  <p><strong>For example:</strong> </p>
  
  <p>If my sentence is : <code>you are a great programmer.</code></p>
  
  <p>It should display : <code>you are a great programmer.</code></p>
  
  <p>But what i get is : <code>you</code></p>
  
  <p>how to code this...can anyone help me with an example?</p>
  
  <p>Here is what i have tried so far :</p>
  
  <pre><code>string b;
      ifstream inFile( "file.txt", ios::in );
      if ( !inFile ) { cerr &lt;&lt; "File could not be opened" &lt;&lt; endl; exit( 1 ); } 
      inFile&gt;&gt;b;
  </code></pre>