ref parameter
A parameter that is an alias for the caller's variable.
ref passes a variable by reference so the method can read and replace it; out requires the method to assign it; in passes a read-only reference.
Loading interactive…
Examples
static void AddTip(ref decimal bill) => bill *= 1.15m;changes the caller's own variable when called asAddTip(ref bill);.
See also