title: Reversing a word : C++
body: <p>I want to reverse a char string in c++.
  I wrote this code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string.h&gt;
  
  using namespace std;
  
  int main(){
      char word[80] = "polymorphism";
      char rev[80];
      int i, j;
      int l;
      l = strlen(word);
      for(i = 0, j = l; i &lt; l-1; i++, j--){
          word[j] = rev[i];
      }
      cout &lt;&lt; rev &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>In terminal it shows some characters like this:</p>
  
  <pre><code>83???uH??? ... Something like this
  </code></pre>