C++ Pointer get address of variable via address operator &

Description

C++ Pointer get address of variable via address operator &

#include <iostream>
using namespace std;
int main()/*from   ww  w. jav a2 s .  c  o  m*/
{
   int num;
   num = 22;
   cout << "The value stored in num is " << num << endl;
   cout << "The address of num = " << &num << endl;
   return 0;
}



PreviousNext

Related