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 |
advantages and disadvantages of using Borland C++ / version 5.
Explain function overloading and operator overloading.
What is the difference between = and == in C?
20 Answers Christ University, Intel,
What is scope resolution operator in c++ with example?
Is there a new/delete equivalent of realloc?
How a modifier is similar to mutator?
When should you use global variables?
What is the best c++ compiler?
what is the difference between overloading & overriding? give example.
Write a program in C++ for Fibonacci series
0 Answers Axtria, ITC Indian Tobacco Company,
What is the average salary of a c++ programmer?
What is the purpose of the "delete" operator?