I have a statement like such that is meant to output what the function returns.
std::cout<<"result: " << calculateAvg(someArray, size) << std::endl;
The function however, outputs things itself before it returns the value. Is there a way for me to print out what is returned on that line, instead of after everything that is printed by the function?