Question: Which line can free the space correctly? int* foo(int x) { int *y = new int[x*x]; return y; } int main() { int z

Which line can free the space correctly? int* foo(int x) { int 

Which line can free the space correctly? int* foo(int x) { int *y = new int[x*x]; return y; } int main() { int z = foo(10); //free space return 0; } Select one: a. delete z; b. delete *z; c. delete *z; d. delete z;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The correct line to free the space correctly is d delete z Heres a breakdown of why this is the corr... View full answer

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 Computer Network Questions!