What is the Output of the below C++ Program?
#include<iostream> using namespace std; int main() { int *ptr = new int(5); cout << *ptr; return 0; }
Studently Changed status to publish October 10, 2022
5
Primitive data types can also be initialised by the new operator. Using the new operator, the value at address “ptr” is set to 5 in the preceding programme.
Studently Answered question October 10, 2022