Rule of Three
mediumQuestion 46Implement the Rule of Three for a class NumberHolder with int* value.
Requirements:
1. Constructor allocates memory
2. Destructor frees memory
3. Copy constructor deep copies
4. Copy assignment operator deep copies and handles self-assignment
5. getValue() and setValue(int)
Do NOT write a main function.
Expected output
5= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Classes
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.