Both are pretty similar - the only difference is that a variable you pass as an
parameter doesn't need to be initialized
, and the method using the out parameter has to set
it to something.
parameters are for data that might be modified
parameters are for data that's an additional output for the function
(eg int.TryParse) that are already using the return value for something
For more detail information please visit the following link:
The out and ref Paramerter in C#
What is the difference between out and ref in C#?