I'm a beginner trying to get the concept of pointers
Why won't this compile?
#include <conio.h> /* for getch() */
using namespace std;
int *pointer; // Declares pointer
cout<<"enter a # for x ";
cin>>x; //Reads in x
cin=*pointer; //Declares a pointer to x
pointer=&x; //Read it, "pointer equals the address of x"
cout<<*pointer; //Note the use of the * to output the actual number stored in x
gets an error at cin = *pointer;
saying that pointer is undeclared........??
Thanks for any input........