To determine the address of a variable, use address operator, & - C++ Data Type

C++ examples for Data Type:Pointer

Description

To determine the address of a variable, use address operator, &

Demo Code

#include <iostream>
using namespace std;
int main()//  www.j a v a 2s .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;
}

Result


Related Tutorials