Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
VB.NET 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
C#
C# General Discussion
Array as function parameter, on stack or on heap?
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="jmcilhinney, post: 4720, member: 3"] The rules about when to use `out` and `ref` are very simple: If you want to use a parameter only to pass a value or object out of a method then use `out`. If you want to pass in one value or object and pass out another then use `ref`. If you want to be able to modify an existing value type inside the method and have that change affect the original value then use `ref`. In all other cases, use the default mechanism, which is passing by value. That is all you have to consider. Only value type objects get copied when passed by value and that should never be an issue because you should be following Microsoft's recommendation that value types should only ever be 16 bytes or smaller. [/QUOTE]
Insert quotes…
Verification
Post reply
C#
C# General Discussion
Array as function parameter, on stack or on heap?
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