N
Navaneeth.K.N
Say I have a class like,
class Sample
{
public decimal first = 10;
public decimal second = 20;
}
I have initialized it
Sample sample = new Sample();
Now how do I calculate the space required for this instance ? I have
calculated in the following way,
decimal takes 12 bytes. Here we have two decimals, hence 24 bytes. And the
variable sample, I believe it takes 4bytes. So total it is 28bytes. Is this
the right way to calculate size utilized ?
Any help would be great
Thanks
class Sample
{
public decimal first = 10;
public decimal second = 20;
}
I have initialized it
Sample sample = new Sample();
Now how do I calculate the space required for this instance ? I have
calculated in the following way,
decimal takes 12 bytes. Here we have two decimals, hence 24 bytes. And the
variable sample, I believe it takes 4bytes. So total it is 28bytes. Is this
the right way to calculate size utilized ?
Any help would be great
Thanks