I Can't Take This Anymore
I've spent all day trying to learn exactly how seperate functions work. For some reason, I'm having a lot of trouble in this area. I need some answers.
Are the function parameters even useful?
If so, can they be used as local variables within the function?
If I wanted a function to return Area, which is and intenger that is assigned the value of length * height, where would I declare these variables? Within the local function? Should they be global variables? Should I declare their values in the main() function?
It seems that whenever I have more then one function in my source code, I tend to get tons of errors because the certain parts of the code aren't in the right place. It seems I dont know some of the DOs and DONTs of functions and code involving seperate functions. Can some one give me some tips?
Thanks:)
P.S. -
Since this is giving me so much trouble, I think I need a step-by-step guide to functions, and what proper function synthax is. Gimme some codes, and just sorta treat me like I'm a complete idiot. Anything. Just so I can learn this stuff, and get on with learning other things in C++