Out, Out, Damn Ref(atalasoft.com)

submitted by ericdcoolestericdcoolest(1200) 4 years, 1 month ago

The difference between the out and ref keywords in C# .. and other questions this brings up.

1 comment |category: |Views: 12

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by senfosenfo(881) 4 years, 1 month ago 0

There is one other important difference that wasn't mentioned. If you reverse the order in which the two methods are called, the code will not compile. This is because the out keyword allows you to pass a variable that have not already been assigned to. A ref argument, on the other hand, requires that the variable be initialized ahead of time.

Reply

information Login or create an account to comment on this story