โ Back to Classes
Question 79
Playlist Track Access (const and non-const operator[])
Playlist Track Access (const and non-const operator[])
You are managing a tiny playlist of 3 song titles. Create a class Playlist with a private array of 3 strings. Requirements: 1) Constructor Playlist(string a, string b, string c) 2) Overload operator[] in TWO ways: - string& operator[](int index) (non-const) - const string& operator[](int index) const Do NOT write a main function.
Expected Output:
Focus Deep Work
Topics:
ClassesOperator Overloading
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.