title: How to reverse a character array in c++?
body: <p>Our teacher wants us to write a program that reverses the order of a character array. So like if the user inputs "hello", the program will output "olleh".</p>
  
  <p>Here's the function that we were given: </p>
  
  <pre><code>void reverse_string(char coolstring[11], char newcoolstring[11])
  {
      int count = 0, count2 = 0;
  
      while(coolstring[count] != '\0')
      {
          count++;
      }
      count -= 1;
  
      cout &lt;&lt; coolstring[count];
      system("pause");
  
      while(coolstring[count] != 0)
      {
          newcoolstring[count] = coolstring[count2];
          count -= 1;
          count2 += 1;
      }   
  }
  </code></pre>
  
  <p>but it doesn't work and I can't find out why while trying to make it work. Could you point me to the right direction?</p>
  
  <p>Any help would be appreciated</p>