Write a complete C++ program with the two alternate
functions specified below, each of which simply triples the variable count defined in main. Then
compare and contrast the two approaches. These two functions are
a) function tripleByValue that passes a copy of count by value, triples the copy and returns
the new value and
a) function tripleByReference that passes count by reference via a reference parameter
and triples the original value of count through its alias (i.e., the reference parameter).
Please don't do other peoples' homework for them. That's not what this site is for. The point of that homework is to help people learn how to do things for themselves, not so that they can not bother to do it till the last minute then get someone on the net to do it for them.
MikeyBoy:
OK~ I did this because the way I feel easier for me to learn is to have the solution first then I go figure it out. Unless he didn't bother to find out why and how the codes are done, otherwise I think he will learn it a faster way... I know many people will not agree with this ;D