I've been told I should only use structs when they are less than 16 bytes. If bigger, it would be more optimal to use a class.
I was wondering, how do I work that out?
Do I just add up all of the fields that are in the struct?
For example, if this struct
public struct Struct1
{
int int1;
}
Then given it's got one integer and one int is 32 bits, is it then four bytes?
What about if I have lots of methods in this struct though? Would the method add to the size of the struct?