how to access a pointer of a pointer in c++ code example
Example 1: c++ pointers
#include <iostream>
using namespace std;
int main () {
int var = 20;
int *ip;
ip = &var;
cout << "Value of var variable: ";
cout << var << endl;
cout << "Address stored in ip variable: ";
cout << ip << endl;
cout << "Value of *ip variable: ";
cout << *ip << endl;
return 0;
}
Example 2: Function pointer C++
void one() { cout << "One\n"; }
void two() { cout << "Two\n"; }
int main()
{
void (*fptr)();
fptr = &one;
*fptr();
fptr = &two;
*fptr();
return 0;
}