Im having a difficulty of what is the use of reference variables and how to use it specially in gaming can someone give me a brief explanation to it...I study advanced in c++ before going to college and Im new to C++ im not even a month so please help me..
This as for instance, what if there will be no reference parameter and also is there any alternative way to do same output without using the reference parameter?
If you want to avoid references, you could replicate the behavior with a pointer. However, there is no guaranteeing that pointer is non-NULL or even valid. The point of a reference parameter is that you will actually be modifying the parameter you pass in, instead of simply getting a copy of its value to work with.
A reference is used here so that changes to score inside getScore will also change courseScore in main.
You can write the program without references by using a return value instead.