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 |
Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?
Write a C++ Program to Multiply two Numbers
What is the return value of the insertion operator?
How much do coding jobs pay?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
What is a volatile variable in c++?
What is a forward referencing and when should it be used?
What are pointer-to-members? Explain.
if i want cin 12345678910 and cout abcdefghij. so how can i create the program?. example : if i key in 8910 so the answer is ghij.
Difference between Overloading and Overriding?
35 Answers Appnetix Techno, GameLoft, HP, IBM, NIIT, Rohde and Schwarz,
Describe functional overloading?
What are the differences between new and malloc?