title: Reading a file and ignoring whitespace
body: <p>how can you able to convert video.movieTitle, video.movieGenre and video.movieProduction into a string. I test my program but it only reads the line and ignore whitespace.</p>
  <pre><code>while((infile,&quot;%d\n&quot;,&amp;p-&gt;video.videoID),
      fscanf(infile,&quot;%s\n&quot;,p-&gt;video.movieTitle.c_str()),
      fscanf(infile,&quot;%s\n&quot;,p-&gt;video.movieGenre.c_str()),
      fscanf(infile,&quot;%s\n&quot;,p-&gt;video.movieProduction.c_str()),
      fscanf(infile,&quot;%d\n&quot;,&amp;p-&gt;video.numberOfCopies))
  </code></pre>
  <p>my file contains:</p>
  <pre class="lang-none prettyprint-override"><code>101
  
  Raya and the Last Dragon
  
  Animation
  
  Walt Disney Studio
  
  6
  
  102
  
  Captain America: The First Avenger
  
  Adventure 
  
  Marvel
  
  1
  </code></pre>