title: How do I correctly read words from a text file and reverse the order of even words?
body: <p>Sorry for the lack of clarity, English is my second language and it can be difficult some times to specify what I need.</p>
  
  <p>I have an assignment to write a c++ program where it: (1)Reads a text file and determines which words are even and which are odd (2)Then it takes even words and reverses the order of characters in each even word.</p>
  
  <p>So for example I have a moderate size text. It picks out even words and reverses their character order.</p>
  
  <p>So far I have written this code and I don't know if it is any good to continue with because I don't know how to reverse the order of characters.
  Thank you for the help.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;string.h&gt;
  #include &lt;cstdlib&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
      string word;
      ifstream f("text.txt");
      if (f.is_open())
      {
          while (f &gt;&gt; word)
          {
              if (word.length() % 2 == 0)
                  cout &lt;&lt; word &lt;&lt; endl;
          }
          f.close();
      }
          else
              cout &lt;&lt; "file is not open" &lt;&lt; '\n';
      }
  </code></pre>