Why for local variables the memory required to hold the
variable is allocated from the program stack and for new
its allocated from the heap?
Answer / achal ubbott
* Stack is a kind of data structure where Last In FirstOut
work. Local variables are needed for a short span of time
for immediate processing. So push and pop from stack is
used for them. Now memory is allocated to them in static
time only.
* new() operator allocates memory dynamically. Since
objects are needed for more time, space is taken from heap.
| Is This Answer Correct ? | 2 Yes | 0 No |
Explain the properties and principles of oop.
Do class declarations end with a semicolon?
What does catch(…) mean?
I need to find a specific string between two strings how do I do it?
advantages and disadvantages of using Borland C++ / version 5.
What is c++ map?
What is jump statement in C++?
If I is an integer variable, which is faster ++i or i++?
What is data type in c++?
How the V-Table mechanism works?
write a program that takes two numbers from user that prints the smallest number
What is pointer to array in c++?