C# Programming - Structures - Discussion
Discussion Forum : Structures - General Questions (Q.No. 7)
7.
How many bytes will the structure variable samp occupy in memory if it is defined as shown below?
class Trial
{
int i;
Decimal d;
}
struct Sample
{
private int x;
private Single y;
private Trial z;
}
Sample samp = new Sample();
Discussion:
12 comments Page 2 of 2.
God Tuss Great ho said:
1 decade ago
Answer is correct. Beacause each type is behave like a integer and integer size should be 4 so answer is 12.
Singham said:
1 decade ago
Answer should be 28, because decimal = 16, int = 4, single = 4.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers