title: C++ read file word by word without any symbol
body: <p>I want to read word by word from a text file. Here's my code in C++:</p>
  
  <pre><code>int main(int argc, const char * argv[]) {
      // insert code here...
  
      ifstream file("./wordCount.txt");
      string word;
      while(file &gt;&gt; word){
          cout&lt;&lt;word&lt;&lt;endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>The text file contains the sentence:</p>
  
  <pre><code>I don't have power, but he has power.
  </code></pre>
  
  <p>Here's the result I get:</p>
  
  <pre><code>I
  don\241\257t
  have
  power,
  but
  he
  has
  power.
  </code></pre>
  
  <p>Can you tell me how to get the result like the below format:</p>
  
  <pre><code>I
  don't
  have
  power
  but
  he
  has
  power
  </code></pre>
  
  <p>Thanks.</p>