I'm studying functions, functions prototypes, declarations. First I tried to create a function with a string return. Then I figured out it is complicated. Here is my last attempt to calculate BMI. I want this BMI() function to stand separate from main() function. Unfortunately I get errors. Here is the code:
Thank you very much. I read "Sams Teach Yourselff C++ in 21 Days" and at the same time I compile and run my own imagination to exercise. Now I understand. My BMI is a void. So I can't std::cout it. It must be something (int, float, char etc.) except void. Am I right?