Out variable

Really loving the course so far. It may be useful to clear up the meaning of out (and ref while we are here) parameters. If I did not already know, I would assume that out simply let you return another variable, not assign a value to an existing reference. C# 7 introduced the inline out variable, before that we used to have to declare variable above and use that as the argument.

Goes to show how good the course is so far that this is my first piece of critical feedback!

I’ll be sure to add in a little extra bit of explanation about the out keyword for those who aren’t familiar, thanks!

Privacy & Terms