title: reverse string in c using pointers
body: <p>I am trying to reverse the string using pointers but it seems that it does not work, what's the problem? the output is <code>olllo</code> but should be <code>olleh</code>.</p>
  
  <pre><code>#include &lt;stdio.h&gt;   
  #include &lt;string.h&gt;   
  #include &lt;stdlib.h&gt;   
  
  
  void reverse(char *cadena){
  
      size_t len = strlen(cadena);
      char *end= cadena;
      char *aux = cadena;
      while(*++end){}
      --end; //end points to a
  
      for(;len;--len){
          *aux++ = *end--;
  
      }
  
  }
  
  int main()
  {
  
      char buffer[] = "hello";
      reverse(buffer);
      printf("%s",buffer);
  
  
      return 0;
  }
  </code></pre>