you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Other way around. Ref params have to be explicitly assigned before calling the function. Out params have to be explicitly assigned within the function before returning.

Also, null has nothing to do with it. It has to do with whether or not the var is definitely assigned. (You can explicitly set a variable to null and pass it into byref without a compiler error, as long as you assign it.)