Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

dynamic memory allocation

int *p = new int; // request memory
*p = 5; // store value

cout << *p << endl; // Output is 5

delete p; // free up the memory

cout << *p << endl; // Output is 0
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #dynamic #memory #allocation
ADD COMMENT
Topic
Name
9+7 =