Out variables in CSharp 7.0 with example

added by DotNetKicks
1/24/2017 4:34:59 PM

3 Kicks, 340 Views

In C#, a method can return only one value. If you would like to return more than one value, you can use the out keyword. Currently in C#, using out parameters isn't as fluid as we would like. Before you can call a method with out parameters, you first have to declare variables to pass to it.