Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Use References operator &

#include <iostream> int main() {     int  intValue;     int &intReference = intValue;     intValue = 5;     std::cout << "intValue: " << intValue << std::endl;     std::cout << "intReference: " << intReference << std::endl;     std::cout << "&intValue: "  << &intValue << std::endl;     std::cout << "&intReference: " << &intReference << std::endl;     return 0; } intValue: 5 intReference: 5 &intValue: 0x22ff74 &intReference: 0x22ff74