C++ examples for Data Type:Reference
A reference address is the address of its target.
#include <iostream> int main() //from w w w. j a v a 2s. co m { int intOne; int &rSomeRef = intOne; intOne = 5; std::cout << "intOne: " << intOne << std::endl; std::cout << "rSomeRef: " << rSomeRef << std::endl; std::cout << "&intOne: " << &intOne << std::endl; std::cout << "&rSomeRef: " << &rSomeRef << std::endl; return 0; }