sorting vector in c++ based on inside vector code example Example: sort a vector c++ sort(a.begin(), a.end());