tripleByValue will create a copy of the count variable when it is called. It then does its calculations on the COPY, not the original one that was defined in main. A return value is needed in this case because the COPY is deleted after the function finishes.
tripleByReference will not copy the count variable...it uses it directly. This approach saves time, especially for large data sets like arrays etc.
However, in the case that the function takes only an integer parameter, I believe (however I'm not 100% sure) that it's actually faster to pass it by value. Any comments on that guys?
AFAIK the difference between passing by value and by reference is significant only when passing larger objects (e.g. a class). Larger objects is better to pass by reference. In case of an int it doesn't matter.
Passing by const reference is for when copying an object would be expensive.
ints, floats, and other small built-in types are better to be passed by value since copying is cheap. Passing an int by const reference will probably have worse performance.