Apprentice coder

Your understanding of what the function does seems correct while your understanding of how to declare and or call functions needs work. None of that is meant to imply any kind of insult.

Since I'm not into writing long replies (and it's not that I don't think you're not worth the effort) I'll send you off to http://www.cplusplus.com/doc/tutorial/functions/ for an explanation.

Please keep asking concerning things you don't understand.