main(){
int x = 5;
int *xPtr;//declare variable xPtr with the type pointer to an int. can also be written as int * xPtr. both correct and the same
//The declaration of the pointer tells you the name of the variable and type of variable that this pointer will be pointing to.
xPtr = &x;//make xPtr point at x,by pointing at x's address(hence &x)
*xPtr = 6;//dereferencing. changes value of the box(x) which xPtr is pointing at.
//if *x isn't declaration, then we can always understand it as "the value of the box x is pointing at"
//Dereferencing a pointer means using the * operator (asterisk character)
//to retrieve the value from the memory address that is pointed by the pointer
printf("x = %d\n",x); //prints 6
}