Question: Given the following struct, do you need to implement the Big Three? Why or why not? struct Leaf { int data; Leaf * left; }
Given the following struct, do you need to implement the Big Three? Why or why not?
struct Leaf
int data;
Leaf left;
;
Leaf right;
Yes, because any classstruct containing a pointer requires Big Three implementation.
No the struct does not dynamically allocate any memory.
No structs automatically deallocate any dynamic memory they reference.
Yes, you should always implement the Big Three, no matter what.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
