What is stack and heap?

Answer Posted / kannan.s

When a program is loaded into memory, it is organized into
three areas of memory, called segments: the text segment,
stack segment, and heap segment. The text segment
(sometimes also called the code segment) is where the
compiled code of the program itself resides. This is the
machine language representation of the program steps to be
carried out, including all functions making up the program,
both user defined and system.

The remaining two areas of system memory is where storage
may be allocated by the compiler for data storage. The
stack is where memory is allocated for automatic variables
within functions. A stack is a Last In First Out (LIFO)
storage device where new storage is allocated and
deallocated at only one ``end'', called the Top of the
stack.

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain copy constructor?

661


What are immutable types in c#?

483


Why do we need constructors?

493


Why do you need boxing in c#?

488


What is data binding with example?

491






Explain the difference between Response.Write () and Response.Output.Write ().

525


How do I simulate optional parameters to com calls?

505


What is function and method in c#?

507


Overloaded constructor will call default constructor internally?

563


How many constructor can a class have?

469


List out the differences between array and arraylist in c#?

521


Explain About Virtual functions and their use.

553


If multiple interfaces are inherited and they have conflicting method names; What will happen ?

504


What is web forms in c#?

497


Why singleton pattern is used in c#?

532