โ Back to Classes
Question 66
Score Prefix Increment (operator++)
Score Prefix Increment (operator++)
You are tracking points in a game. Create a class Score with a private int points. Requirements: 1) Constructor Score(int p) 2) int getPoints() const 3) Overload PREFIX operator++ to add 1 point and return *this Do NOT write a main function.
Expected Output:
11 0
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.