Help With c++ HW

Seeing as how I cant reply for whatever reason ill post here. Thank you repeater for your help.
Last edited on
You are passing, to your functions, copies of variables. This is known as pass by value.

The functions are then working on those copies. When the function finishes, the copies are discarded. The original values, in main, are not touched.

If you need a function to change a value in the caller, pass by reference.

http://www.cplusplus.com/doc/tutorial/functions/ , half way down; Arguments passed by value and by reference

You're also ignoring what you pass to the function and creating whole new variables inside the functions. I don't know what you expected to happen. You need to stop, go back, and learn about functions before you go any further.
Last edited on
Topic archived. No new replies allowed.