C# Programming - Structures - Discussion
Discussion Forum : Structures - General Questions (Q.No. 1)
1.
The space required for structure variables is allocated on stack.
Discussion:
6 comments Page 1 of 1.
Gajendra said:
1 decade ago
Since structure is ValueType it will get space on stack.
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".
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.
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:
1 decade ago
All value types have memory allocated on stack in c#. Structure is a value type.
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.
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.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers