Programing with functions

Pages: 12
no i mean like calling it. like regAmnt = regularAmtDue( in hear i place new variables that are designated in main function)
Yes, you would use variables or numbers or strings that you have in the main function or whichever function you are calling regularAmtDue from. This is called 'passing parameters' or 'passing arguments'. Glad you understand. Good luck!
Thank you so much! hopefully i can do this.
oh! just one more questions, for parameters that are set as references so they have the "&" in front of them, how would I go about changing that in the main function. for example one of my functions has regularAmtDue (int minUsed, double &amtDue) when I change amtDue to the variable i have designated in main do I have to put the & sign or no?
No, in main you just give it the variable name as always. C++ handles the super cool reference stuff for you. (Cooler than pointers!)
:) thank you!!!
again thank you very much!!! I have completed my assignment and It works like a charm! You've been amazing!!
Topic archived. No new replies allowed.
Pages: 12