Hi, I am supposed to be converting numbers from cm to inches using void functions.
When I debug, I can enter the cm, but it is not converted correctly, which leads me to think that there is something wrong with my mathematical part. I know that 1 in = 2.54 cm, but I can not for the sake of me figure out what I am doing wrong, I have changed my code 1oo times, so its probably good and messed up now. could someone point me in the correct direction??
#include <iostream>
#include <iomanip>
using namespace std;
Line 6, 24: Your second argument is passed by value which means calcInches() is working on a copy of the value. Any changes made to cmMeasurement are not reflected in the caller.
Change lines 6 and 24 to pass the second argument by reference.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.