Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sort_movies(Movie V[], int n) {
- Movie swap;
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- if (larger_than(V[i], V[j]))
- {
- swap = V[j];
- V[j] = V[i];
- V[i] = swap;
- }
- }
- }
- }
- bool larger_than(const Movie& m1, const Movie& m2) {
- int compare = 0;
- compare = m1.name.compare(m2.name);
- if (compare < 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement