sizeof: practical reference
sizeof: practical reference: sizeof returns a type's size in bytes; in safe context it is permitted only for a built-in unmanaged type with platform-independent size or an enum.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
sizeof: practical reference: sizeof returns a type's size in bytes; in safe context it is permitted only for a built-in unmanaged type with platform-independent size or an enum.
-: practical reference: - subtracts numbers, negates a unary operand, or computes differences for supported time types.
-=: practical reference: -= subtracts and assigns; for an event it unsubscribes a delegate.
typeof: practical reference: typeof returns a Type object for a compile-time-known type without constructing an instance.
The +x operator returns its operand's numeric value without changing its sign. It neither increments a variable nor computes an absolute value. For small integral types, the result has type int.
>>>: practical reference: >>> shifts right logically and always fills with zeros.
>>>=: practical reference: >>>= performs a logical right shift and assigns the result.
The string and string? annotations express intent about null, while compiler flow analysis warns about unsafe use. The #nullable context controls annotations and warnings independently; it does not add runtime checks.
String interpolation inserts expression results directly into text using $"..." syntax. It supports value formatting, alignment, and literal braces; choose a culture explicitly when numeric formatting must be predictable.
bool: practical reference: bool is the System.Boolean alias with true and false values.
byte: practical reference: byte is an 8-bit unsigned integer ranging from 0 through 255.
char: practical reference: char is a 16-bit UTF-16 code unit, not a complete Unicode character.
decimal: practical reference: decimal is a 128-bit base-10 numeric type with high decimal precision.
double: practical reference: double is a 64-bit IEEE 754 binary floating-point type.
The dynamic type defers operation binding until runtime. It simplifies interaction with dynamic APIs, but missing members or incompatible arguments can cause RuntimeBinderException instead of a compilation error.
float: practical reference: float is a 32-bit IEEE 754 binary floating-point type with about seven decimal digits of precision.
int: practical reference: int is the alias for the 32-bit signed System.Int32.
long: practical reference: long is the 64-bit signed System.Int64 type.
nint: practical reference: nint is a signed integer whose width matches the native pointer size.
nuint: practical reference: nuint is an unsigned integer whose width matches the native pointer size.
The object keyword is an alias for System.Object. It can hold references to objects of different types and boxed values. Learn how equality, reference identity, and hash codes differ, and how to recover a more specific type safely.
sbyte: practical reference: sbyte is an 8-bit signed integer ranging from -128 through 127.
short: practical reference: short is the 16-bit signed System.Int16 type.
string: practical reference: string is the alias for immutable System.String storage encoded as UTF-16 code units.