I was told that I should only use structures when they are less than 16 bytes. If more, using the class would be more optimal.
I was wondering how can I solve this?
Am I just adding all the fields that are in the structure?
For example, if this struct
public struct Struct1
{
int int1;
}
Then, if it has one integer and one int is 32 bits, then is it four bytes?
How about if I have many methods in this structure? Will the method add to the size of the structure?
source
share