This might be looking a naive question, but i am facing a big issue because of this.
I have a class written in C# .Net which contains one more class.
And i need to pass the size of this complete class to a method used for communication to the hardware.
But whn i tried to calcuate the size of class it gave me that Sizeof can not be used without unsafe method.
Expand|Select|Wrap|Line Numbers
- public class MainClass
- {
- public int a;
- public byte b;
- }
- public class wrapperclass
- {
- public int b;
- public MainClass obj;
- }
I tried using SizeOf(typeOf(wrapperClass)) but is gives me compile errors.
Any help will be appreciated.
Thank,
Eric