C# Programming - Structures - Discussion

Discussion Forum : Structures - General Questions (Q.No. 1)
1.
The space required for structure variables is allocated on stack.
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
6 comments Page 1 of 1.

Sailu said:   9 years ago
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.

Sonia said:   10 years ago
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.

Aishwarya K said:   1 decade ago
All value types have memory allocated on stack in c#. Structure is a value type.

Nicholas Mahbouby said:   1 decade ago
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.

Ganeshram said:   1 decade ago
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".

Gajendra said:   1 decade ago
Since structure is ValueType it will get space on stack.

Post your comments here:

Your comments will be displayed after verification.