Hello all. I have a question for homework purposes. Now, I am not asking anyone to do this FOR me. I need help understanding part of it. therefore, I will copy and paste the assignment and divert your attention to the question at hand.
1. Write a complete C++ program with the two alternate functions specified below, of which each simply triples the variable
count defined in main. Then compare and contrast the two approaches. These two functions are
a) Function tripleCallByValue that passes a copy of count call-by-value, triples the copy and returns the new value.
b) Function tripleByReference that passes count with true call-by-reference via a reference parameter and triples
the original copy of count through its alias (i.e., the reference parameter).
My question is about the triple variable count. I understand in loops you have a counter such as:
while (int num=1; num<=10; num++)
now the num++ will only increase it by one. How can I triple this?? Or am I completely missing the objective?