What is the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int* ptr = new int;
*ptr = 10;
delete ptr;
cout << *ptr;
}
0
Runtime error
10
Garbage value
This question is part of this quiz :
Quiz on C++ Memory Management