Remember that a pointer doesn't point to any literals exactly, it points to the memory address of the variable in question.
If you tried to run that program now, the "passbypointer" member function would display the memory address of the variable "x" instead of the data held by the variable "x". You need to de-reference "x".
You can de-reference variables by placing an asterisk (*) before the variable.
1 2 3 4 5
void passbypointer(int *x)
{
*x += 2; // if we didn't dereference this statement, it would add 2 to the memory address.
cout << *x << endl;
}
1 2 3 4 5 6
int x = 5;
int* bob = &x;
cout << x; // this would display "x" which the value is "5".
cout << bob; // this would display the memory address of "x".
cout <<*bob; // this would display "x" which the value is "5".
Also the return type for main should be "int" not "void".