title: Sorting on pairs in c++
body: <p>I am writing a code for activity schedule problem. If i store the starting time and finishing time in an array of pairs like <code>pair&lt;int,int&gt;p[10]</code>  and after this i need to sort the activities as per finishing time with increasing finishing time,omitted the part where it asks user to input and then make pair for simplicity,hope it won't be a problem for the guy to answer  so i apply <code>sort(p,p+n)</code> where n means no of activities ,i don't get like will it sort all starting activities this way or the finishing activities this way.So this is the code.<code>pair &lt;int,int&gt;p[10]
  Sort(p,p+6)</code></p>