University of Lethbridge - CPSC
main()
Assignment 1 - Movie2 - SM 25What is this function?
This is the main driver of your program. It controls the flow of the program and handles user interaction.
The main() function:
Collects movie data from the user
Sorts the list using your comparator
Repeatedly asks the user to search for a title
Runs both searches (linear and binary) for each term
Uses
search_and_report()to print the results
Thanks to vectors and STL, this version of main() is much simpler than the one from movie1.cpp.
How does the function work?
Members only
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 27 more lessons in University of Lethbridge - CPSC.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.