Answers for "dynamic memory alocatoin c++"

C++
1

dynamic memory management c++

// declare an int pointer
int* pointVar;

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

// assign value to allocated memory
*pointVar = 45;
Posted by: Guest on May-03-2021

Browse Popular Code Answers by Language