I'm not too sure how well I did when I wrote this function. It does work just fine, but I'm worried that there might be a better way of doing this (in fact, I'm fairly sure there is).
I need the function to return a string with the result. I know that C++ has a method of doing it itself, but it seems to only display the result and not save it in a variable like I need it to. Any suggestions?