Question: Assume p and q have been declared as pointers to integers. After execution of the following statements, what value does the variable q contain? p

Assume p and q have been declared as pointers to integers. After execution of the following statements, what value does the variable q contain?
p = new int;
q = p;
delete p;
p = nullptr;
Group of answer choices
the address of the deallocated memory cell
the value NULL
the address of p
q does not point to anything

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!