title: Sorting char arrays by swapping pointers, C++
body: <p>I am trying to sort an array of char pointers (char * _string) by swapping pointers.</p>
  
  <p>I have this method, and what I want to do is use the values I get from _string and sort them by not manipulating _string, but the empty helper array (char * _output) which I also hand over to the method. </p>
  
  <p>Can anyone help me and tell me what I am doing wrong?</p>
  
  <pre><code>void sortAsc(char* _string, char* _output) 
  {
  
      int length = strlen(_string);
  
          // output and string now point to the same area in the memory
      _output = _string; 
  
      for( int i = 0; i &lt; length; i++) {
            for( int j = 0; j &lt; length; j++) {
                  if( *(_output) &gt; (_output[j] ) ) {
  
                      // save the pointer
                      char* tmp = _output;
  
                      // now output points to the smaller value   
                      _output = _output+j; 
  
                      // move up the pointer to the smaller value
                      _output + j; 
  
                      // now the pointer of the smaller value points to the higher value
                      _output = tmp; 
  
                      // move down to where we were + 1
                      _output - j + 1; 
  
              }
          }
      }
  
      //_output[length]='\0';
  
      //delete chars;
   }
  </code></pre>
  
  <p>In my main-Method, I do something like this:</p>
  
  <pre><code>char * string = {"bcdae"};
  char * output = new char[5];
  sortAsc(string, output);
  </code></pre>
  
  <p>After that code, I want the output array to contain the sorted values.</p>