Answers for "dynamic memory management c++"

C++
1

dynamic memory allocation in c++

char* pvalue  = NULL;         // Pointer initialized with null
pvalue  = new char[20];       // Request memory for the variable
Posted by: Guest on November-08-2020
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

Code answers related to "dynamic memory management c++"

Browse Popular Code Answers by Language