References

References are similar to C++ references. They allow to access the value of a variable in a usual way, but they refer to some data (like pointers). You can create a reference by placing & character before the name of the variable while definition. References must be initialized, they point to the same memory all the time. References may be created only on the stack. They must be initialized by assigning a variable of the same type.

Below the example of reference declaration.


Vec2f v(10, 10);   //some stack variable
Vec2f &y = v;      //defining a reference (&),  now y refers to v

y.x = 5;           //changing value of y accually changes v 
y.y = 11;