CJCoding With Joseph
15per day

Rule of Three

Implement 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
Topics:
Classes
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.