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();
20 bytes
12 bytes
8 bytes
16 bytes
24 bytes
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
12 comments Page 2 of 2.

Priyali said:   1 decade ago
Can someone tell me what is the correct answer please?

Ibtisam said:   6 years ago
@Ramprasad.

Why is reference to trial = 4?


Post your comments here:

Your comments will be displayed after verification.