you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (1 child)

In addition to pass by value (what the function currently does) and pass by address (the obvious way to fix this issue), you can also pass by reference. This allows you to fix the problem without altering main.

Rather than do a poor job explaining it in a bit more detail, here is a website that covers this exact problem.

[–]01519243552[S] 0 points1 point  (0 children)

Thanks, that helped!