What is stack and heap?

Answers were Sorted based on User's Feedback



What is stack and heap?..

Answer / sharif

Stack memory is maintain the value types
heap meamory is maintain the reference type

Is This Answer Correct ?    21 Yes 0 No

What is stack and heap?..

Answer / jaikumar.c

Stack is memory to store objects in Ram memory.
Heap is kernal alloted memory to store objects

Is This Answer Correct ?    13 Yes 7 No

What is stack and heap?..

Answer / maria

I think stack is a memory that is used to store actual
values of an object whereas Heap is a memory that is used
to store references of the objects. Iam student of IUB
bahawalnagar campus. I hope you will give opinion on it.

Is This Answer Correct ?    4 Yes 1 No

What is stack and heap?..

Answer / pushparaj pentakota(anakapalli

stack can store value type and reference type also but at compile time only but heap can store objects at run-time.stack can't store objects bcz stack at run-time can't increse their memory size it's fixed length.objects need extra memory sometimes so objects allocate memory in heap context.

Is This Answer Correct ?    2 Yes 0 No

What is stack and heap?..

Answer / maria

I think Stack is memory location that is for storing real
object values wheres Heap is used to store just reference
of objects. I am student of IUB bahawalnagar campus. Are
you agree with my
thought.
Thanks

Is This Answer Correct ?    2 Yes 1 No

What is stack and heap?..

Answer / 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

What is stack and heap?..

Answer / vijay rana

stack is used for store value types;
heap is used for store reference type values;

Is This Answer Correct ?    9 Yes 9 No

Post New Answer

More C Sharp Interview Questions

Is c# easier than javascript?

0 Answers  


Is datetime value type c#?

0 Answers  


What is the difference between string and string in c#?

0 Answers  


Can overrride the Main method

6 Answers   NIIT,


What are the three types of predicates?

0 Answers  


How many types of constructors are there?

0 Answers  


hi In my database i put id column as identity(the database is incremented by it self only)what i want is if i enter a data in my website, id will come automatically can u pl z tell me the code thax in advance

1 Answers  


What can we do to handle multiple exceptions?

0 Answers   Accenture,


Is arraylist type safe in c#?

0 Answers  


What are the types of threading models ?

4 Answers   Digital GlobalSoft,


What are the Uses of CLR

0 Answers   TCS,


Can int be null c#?

0 Answers  


Categories