C++ examples for Data Type:Reference
Creating an Object Alias
#include <iostream> #include <string> using namespace std; int main() /*from w w w . ja v a2 s . c o m*/ { string my = "Hello"; const string &StringCopy(my); my = "Goodbye"; cout << my << endl; cout << StringCopy << endl; return 0; }