i have a code that i want to ask you for a number than give you the pointer to the number and then ask you what you want the pointer to be changed to and it dosen work it wont compile without an error message
Code:
#include <iostream>
using namespace std;
int times,number,pointer;
int *p;
int main()
{
cout<<"how many time will we make a pointer?"<<endl;
cin>> times;
while( times >= 0 )
{
cout<<"I need a number:"<<endl;
cin>> number;
p = &number;
cout<<"The ponter of "<<number<<" is: "<< p<<endl;
cout<<"What will its new pointer be?"<<endl;
cin>> *p;
number = p;
cout<<"the pointer of number is now "<< *number<<endl;
times --;
}
}