↑ Grab this Headline Animator

Saturday, August 9, 2008

Difference between using ByVal and ByRef in VB or using ref in c#

The ByRef use, would imply that a change performed by the statement of the value you pass, has an affect on the actual data, while the ByVal use would only alter the copy the statement has to work on.

Simply described, if passed ByRef, a procedure can permanently alter the data stored in the variable. Since it also is faster to send a memory address location, rather than passing a copy of a data argument, it is the default value used by Visual Basic.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.


Latest Articles