Question: C++ function Consider the following C++ function: int *create_node (int n) {int *p1 = new int (n); int *p2 = new int (n); int *p3

C++ function

C++ function Consider the following C++ function: int *create_node (int n) {int

Consider the following C++ function: int *create_node (int n) {int *p1 = new int (n); int *p2 = new int (n); int *p3 = p2; int *p4 = p1; q = p1;//q is an external variable return p3;} When create_node returns, how many of the anonymous variables that it creates will be garbage

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!