What is the difference between
private void DoSomething(int value) {
value++;
}
and
private int DoSomething(int value)
With most programming languages, you would need to change up your void function by passing the parameter by reference. A function usually can't change the value of its parameters; instead, it creates a copy of the parameter and works with that instead.
In order to work with the actual variable, you have to change the function header to accept a reference to the variable, with a preceding ampersand (&) like this:
private void DoSomething(int &value)
Hope that helps!