When should I use REF and when to use OUT?

I am confused about using REF and OUT. Can anyone please explain me when I should be using REF and OUT.
RajG1978Asked:
Who is Participating?
 
Paul JacksonSoftware EngineerCommented:
A REF Parameter must be initialized before calling the function, whereas an OUT parameter does not.

Ref - the variable must be initialized before calling the function and will be modified by the called function.

Out - the variable does not need to be initialized before calling the function and will be initialized inside of the function.

A good example in the following link:

ref and out the inside story
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.