Pointers actually is a data type that contains the address of another piece of data.
We can use ampersand symbol & to obtain the address of any variable in C++.
The address changes every time we execute the code.
Having an asterisk * after the data type to define a pointer.
We can't store the address of a double variable into an integer pointer.
The asterisk * can be located either right after the data type or right before the name of the variable.
#include"stdafx.h"#include<iostream>usingnamespace std;intmain(){int number =240;// Define an int variableint* numPtr;// Define an integer pointer numPtr
numPtr =&number;// assign the address of number to numPtr
cout <<"The address of number is "<< numPtr << endl;return0}