A pointer has only one purpose: to point to an address. Address, is the computer memory address, used to identify the location of memory.

#include <iostream>

using namespace std;
 
#include <stdio.h>
 
int main (a)
{
    int a = 10;
    int *p;              // Define pointer variables
    p = &a;				//p refers to the address of a, &a is to fetch the address
 
   cout<<"*p variable value :"<<*p<<endl; *p can get the value of the address p points to.


    cout<<"Address of variable A :"<<p<<endl;
   return 0;
}
Copy the code

Pointers should be a difficult part of c++ as an introductory tutorial. Xiaobian will not expand the explanation here.