I have a C ++ exam and I have been solving a few of the past years. I have this question in one of them:
The function calculates the prysm volume. Skipped arguments are height, depth, and width. Arguments and return value double. Depth is optional and should have a default value of 10. Hypothesis 1: All parameters are passed a value
I replied double volume_prysm(const double width, const double height, const double depth = 10);
Hypothesis 2: All parameters are passed by reference
How to define a reference parameter so that it defaults to 10?
Thank you for your time!
PS: Sorry you did not translate
source
share