The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Array Conversions in C#
1 Comment
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.

David BozjakPosted Feb 18, 2010, 3:07 AM
ref keyword in the methods is unnecessary, and should be removed. Even if you weren't just printing values, arrays are already sent by reference, so I can't really see the reason behind ref keyword. You should only use ref keyword when you want the reference in the calling function to change. In your example, the only reason you would want to use a ref keyword is when you want the myIntArray in main to change to null after calling a method. I suggest you read this excellent article about parameter passing: http://www.yoda.arachsys.com/csharp/parameters.html by Jon Skeet