I am trying to declare a reference variable to a pointer.
#include<iostream>
using namespace std;
int main()
{
int m = 10;
int *p = &m;
int & ref = p; // this is showing error
}
I am reading a c++ book and in the book i saw this code, but this is showing an error. It is supposed to set ref as a reference variable to point to pointer p and in turn point to m.