CJCoding With Joseph
15per day

Fix Shallow Copy

Create a class BadCopy with an int* data pointer. Implement a constructor, destructor, and copy constructor so copying is deep (no shared pointer). Add getValue() to return *data.

Do NOT write a main function.

Expected Output:

42
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.