C# Tutorial: Passing Value Types by Reference, In Ref and Out Keywords

C# Tutorial: Passing Value Types by Reference, In Ref and Out Keywords

Passing Value Types by Reference, In Ref and Out Keywords
Check out our Learning Paths to become a great developer: https://bit.ly/2R9Gshv

If you've ever tried passing a value type to a function and had it fail with the error "Cannot pass by reference", then this video is for you. The C# language allows developers to call functions that take parameters by reference, but not all types are allowed. In this article, we'll explore when it's okay to use ref or out keyword for your parameter types.

In this video, we will talk about passing values by reference.

How to do it, when to do it, and most importantly which keyword to use.

Because in C# there are THREE keywords to pass a variable by reference and each one of these keywords behaves differently, without further ado let's jump right into it : )

What are these passing values by reference?.

We discussed passing values by reference VS by values earlier but here is a refreshment for your memory.




tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
Stay tuned and subscribe to tutorialsEU: https://goo.gl/rBFh3x

TutorialProgrammingCourse

Post a Comment

0 Comments