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 =20;
cout << age << endl;
delete age;
*age =*age *3;
cout << age << endl;
Which of the following statements is correct?
Question 4 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 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 Programming Questions!