title: How to sort one array and get corresponding second array in C++?
body: <p>I have two arrays in same size. And want to sort one of the array normally and then sort the next array elements accordingly.
  Let's say we have two arrays </p>
  
  <pre><code>e[] = {4,2,3,7,6,8}
  s[] = {2,0,4,3,7,9}
  </code></pre>
  
  <p>First I want to sort array <code>e</code> normally, Then change the element positions of <code>s</code> array according to the changed element positions of <code>e</code>.</p>
  
  <p>This should be the final result </p>
  
  <pre><code>e[] = {2,3,4,6,7,8}
  s[] = {0,4,2,7,3,9}
  </code></pre>
  
  <p>How should I do this? Should I use a class object with these two as private members and then proceed? If so, how to do that?</p>