Allocating Memory by Using new - C++ Operator

C++ examples for Operator:new

Description

Allocating Memory by Using new

Demo Code

#include <iostream>

using namespace std;

int main()//from ww  w. j a  v  a  2  s. c  om
{
  int *ptr = new int(10);
  
  cout << *ptr << endl;
  
  return 0;
}

Result


Related Tutorials