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 |
Should the this pointer can be used in the constructor?
How do we balance an AVL Tree in C++?
Write about the retrieval of n number of objects during the process of delete[]p?
Explain selection sorting. Also write an example.
Explain stack & heap objects?
Write syntax to define friend functions in C++.
C is to C++ as 1 is to a) What the heck b) 2 c) 10
How do you find out if a linked-list has an end?
Where the memory to the static variables is allocated?
What are the vectors in c++?
what are the events occur in intr activated on interrupt vector table
Is c++ a high level language?