Calculate the number of bytes a structure variable s occupies in the memory if it is defined as follows.
class abc
{
int i;
Decimal d;
}
struct sample
{
private int x;
private Single y;
private trial z;
}
sample s = new sample();
class abc
{
int i;
Decimal d;
}
struct sample
{
private int x;
private Single y;
private trial z;
}
sample s = new sample();A. 24 bytes
B. 8 bytes
C. 16 bytes
D. 12 bytes
Answer: Option D
Related Questions on Classes and Objects in C Sharp
A. A blueprint for creating objects
B. A method in C#
C. A variable in C#
D. A data type in C#
A. A method in C#
B. A variable in C#
C. An instance of a class
D. A data type in C#
A. public
B. private
C. protected
D. internal

Join The Discussion