public class A { int x; float y; }
How to find the size of the class in C#. Is there any operator like Sizeof(), which used to be in C++
You could serialize the class into a memory stream and then get the size from there, but I wouldn't really recommend doing this unless you had to.