Get Addresses of variables - C++ Operator

C++ examples for Operator:Address Operator

Description

Get Addresses of variables

Demo Code

#include <iostream>
using namespace std;
int main()/*from   w  ww.j  a v  a  2 s  .co  m*/
{
   int var1 = 11;           //define and initialize
   int var2 = 22;           //three variables
   int var3 = 33;
   cout << &var1 << endl    //print the addresses
       << &var2 << endl    //of these variables
       << &var3 << endl;
   return 0;
}

Result


Related Tutorials