I have a method, which returns void. It sets some values in an array, depending on an if/else statement.
However, if the code enters the else statement, this operation cannot be performed. What could I return to the calling method (a method in the code-behind of a winforms form), to indicate this operation did not suceed?
Thanks
you can use as OUT parameter, Out parameter must be assigned within the method, before it return the value or else compiler will raise the error.
Out Parameter Documentation