Question: C + + consider the following code snippet. int * age = new int; * age = 2 0 ; cout < < age <
C consider the following code snippet.
int age new int;
age ;
cout age endl;
delete age;
age age ;
cout age endl;
Which of the following statements is correct?
Question options:
There is no error in the code snippet.
The age pointer is being used after the memory it is pointing to has been deleted.
There are compilation errors.
The age pointer was never initialized.
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
