‘ref’ and ‘out’ in C# is Bizarre and confusing…

I tried to really see the difference of these key words in C# and i still get it weired.

http://msdn2.microsoft.com/en-us/vcsharp/aa336814.aspx

  • for ‘out’, we can pass the variable unassigned but we have to make sure we assign it before use in the callee method
  • for ‘ref’, we have to assign the variable before we pass it…

i still see both as pass by reference kind of thing…

any suggestions….?

To enable comments sign up for a Disqus account and enter your Disqus shortname in the Articulate node settings.