Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
VB.NET General Discussion
ByRef vs ByVal
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="JohnH, post: 95394, member: 5139"] A variable is a named memory location, it holds a value for value types or a memory address aka [I]reference[/I] for reference types. ByVal parameters make a copy of the value or reference that was passed, just like declaring a new variable and assigning it something, so in the latter case a new reference is created pointing to the same object the original variable was pointing to. With ByRef a new variable is not created, the same variable aka memory location that was passed in is also used within the method. So for reference types a ByRef parameter only matters if you need to assign a new instance, if it was ByVal and you assigned a new instance in the method it would not be reflected in the original variable. [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
VB.NET General Discussion
ByRef vs ByVal
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom