Putting a Value in Parentheses to Initialize Memory That You Allocate - C++ Operator

C++ examples for Operator:new

Description

Putting a Value in Parentheses to Initialize Memory That You Allocate

Demo Code

#include <iostream> 

using namespace std; 

int main() /*from w  w w  .  j a  va 2 s. co m*/
{ 
  int *ptr = new int(10); 

  cout << *ptr << endl; 

  return 0; 
}

Result


Related Tutorials