Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ new Operator

// declare an int pointer
int* pointVar;

// dynamically allocate memory
// using the new keyword 
pointVar = new int;

// assign value to allocated memory
*pointVar = 45;
Source by daynhauhoc.com #
 
PREVIOUS NEXT
Tagged: #Operator
ADD COMMENT
Topic
Name
6+3 =