What is the difference between stack and heap memory?



What is the difference between stack and heap memory?..

Answer / nashiinformaticssolutions

o Stack: Memory is allocated and deallocated automatically.
o Heap: Memory is allocated dynamically using new or malloc.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

when can we use virtual destructor?

7 Answers   HCL, HP, Virage Logic,


What is constructor in C++?

0 Answers  


What are the popular tools used to detect memory leaks in c++

4 Answers   TATA,


Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.

3 Answers  


Which function should be used to free the memory allocated by calloc()?

0 Answers  


What is the use of 'this' pointer?

0 Answers   Fidelity,


What will the line of code below print out and why?

0 Answers  


"How will you merge these two arrays? Write the program Array: A 1 18 22 43 Array: B 3 4 6 20 34 46 55 Output Array: C 1 3 4 6 18 20 22 34 43 46 55"

9 Answers   College School Exams Tests, HCL,


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

0 Answers  


Why pure virtual functions are used if they don't have implementation / When does a pure virtual function become useful?

1 Answers  


whats the size of class EXP on 32 bit processor? class EXP { char c1; char c2; int i1; int i2; char *ptr; static int mem; };

5 Answers   Huawei,


What is null pointer and void pointer and what is their use?

0 Answers  


Categories