I decided to to read some of the tutorials again to clarify stuff I missed and such.
Code:
#include <iostream>
using namespace std;
int main()
{
int x; // A normal integer
int *p; // A pointer to an integer
p = &x; // Read it, "assign the address of x to p"
cin>> x; // Put a value in x, we could also use *p here
cin.ignore();
cout<< *p <<"\n"; // Note the use of the * to get the value
cin.get();
}
Alright how I understand this is p is a pointer due to the *. p points to the address of x because of the &. So becuase p points to x it should display the value of x?