i am a new convert to c++, why, its because C++ is the base of so many thing, plus, i want a challenge, not that i dont get it from other langauges like C# or python, and those are good langauges in my opinion, but c++, i always been fond of it, always looked at it as the next stepping stone to a challenge, so, simple stupid noob question, what is the difference between declaring and using variable a and variable a&?

In the latter case, I changed the function parameter type from "int" to "int *" (a memory address of an 'int' rather than the 'int' itself). The "&" is now required when calling myFunc () because C++ needs an address (& tells it to use the address) rather than a value.

However, pointers are not recommended, so you should avoid them when possible (see this SO answer). Luckily, C++ has references. Under the hood, references are just pointers, but programming them is usually better than programming pointers. Changing the code above to use references:

Notice that only one part changed: an "&" for the one argument of myFunc (). So the parameter type is "int &" rather than "int". The myFunc () gets a reference to "x" rather than a value, so myFunc () could change our "x" if it wanted to. Like so: