@© : Binds a reference to an object.
hargecezeatey —» C & A] CON born axess
ie il; wate) 8 Chanog +nenalve 4
Reference initialization is used implicitly when a value is passed by reference or
a reference is returned from a function.
7. Reference Initialization
Referencewariablesimustiberinitializediwhemitheyareidectared. This kind of initialization binds
the reference to an existing variable.
Example:
cop copy code
#include
int main) ¢
int a = 42;
int& ref =
std::cout << "ref: " << ref << std::endl; Output: ref
ref = 160;
std::cout << "a: "