#include<iostream>
using namespace std;
int teradata=65;
int &pointer(int *p2)
{
p2=&teradata;
return &p2;
}
int main()
{
int a=10;
int *p=&a;
int **p3;
p3=pointer(p);
cout<<p3;
return 0;
}
Actually I am trying to return the address of pointer p2
and store it in pointer p3
which is a pointer to a double. Please help correct this program and tell me the error which I did in this program.