C++ Programming :: OOPS Concepts - Discussion
4 / 14
What is the technique of allocating memory during runtime on demand known as in C++?
ADynamic binding
BDynamic memory allocation
CLate binding
DRuntime polymorphism
Show Explanation
int * x; //declare a pointer
x = new int; // dynamically allocate memory of type int and assign its address to x
Asked In ::
Answer is Dynamic memory allocation. We use 'new' operator in c++ to dynamically allocate memory in runtime. We can dynamically allocate space in runtime but we can not create new dynamic variables. for this reason usually we create dynamic variable and we store its address in a pointer. Below is one example of dynamic memory allocation.
int * x; //declare a pointer
x = new int; // dynamically allocate memory of type int and assign its address to x
Read Full Answer
Report Error
Please Login First Click Here