411 REFERENCE · Wikibooks
C Sharp Programming/Keywords/sizeof
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Keywords sizeof
The sizeof keyword returns how many bytes an object requires to be stored.
An example usage:
int i = 123456;
Console.WriteLine("Storing i, a {0}, requires {1} bytes, or {2} bits.",
i.GetType(), sizeof(i), sizeof(i)*8);
// outputs "Storing i, a System.Int32, requires 4 bytes, or 32 bits."