Definition:A reference variable is a “reference” to another variable. Better definition: A reference variable is just another pointer variable which will take its own space in memory from here References are nothing but constant pointers in C++. A statement
int &i = j;will be converted by the compiler to
int *const i = &j. Again from here
Usage:Declare a reference as such with the “&”:
Join 7000+ other code newbies
Last year 7000 newbies learned how to code with me! Totally project oriented.
Subscribe and you'll get access to my classes, coupon codes for tech conferences and totally valuable article on jump-starting your career as a developer.