PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code. Along with the proper indenting it makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/ Hint: You can edit your post, highlight your code and press the <> formatting button. This will not automatically indent your code. That part is up to you. You can use the preview button at the bottom to see how it looks. I found the second link to be the most help. |
double length{}, width{}, area{}, perimeter{};
double getInput(double l, double w)
, But never use "l" and "w" in the function. Also try to avoid the letters lower case "L" and "O". In some type styles they can easile be mistaken for the numbers (1) and (0). You can very easily use: double getInput(double length, double width)
.return len, wid;
does not work. A function can only return 1 thing. The exceptions would be a vector or other container class or a tuple, but I doubt that you have studied tuples yet.void getInput(double& length, double& width)
. Passing the variables by reference will change these values back in "main". Then there would be no reason for a return value.
|
|
|
|
|
|