C# Programming - Structures - Discussion

Discussion :: Structures - General Questions (Q.No.1)

1. 

The space required for structure variables is allocated on stack.

[A]. True
[B]. False

Answer: Option A

Explanation:

No answer description available for this question.

Gajendra said: (Nov 25, 2012)  
Since structure is ValueType it will get space on stack.

Ganeshram said: (Apr 8, 2014)  
Option A is correct. Structure is a value type. Value type variables are stored on stack and Reference type variables are stored on heap in Memory. So the "space required for structure variables is allocated on stack is true".

Nicholas Mahbouby said: (May 7, 2014)  
Answer A is true in the case of local variables but not necessarily for member variables.

If the value type is a local variable it will always be created on the stack.

If the value type is a member variable of a reference type it will be created on the heap with the reference type.

Aishwarya K said: (Jun 28, 2015)  
All value types have memory allocated on stack in c#. Structure is a value type.

Sonia said: (Jan 9, 2016)  
If you're reading this you're parents are going to die in 5 years (sorry had to do this) re-post 5 times to undo curse.

Sailu said: (Jul 1, 2016)  
If you're reading this your parents are going to die in 5 years (sorry had to do this) repost 5 times to undo the curse.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.