How to return by reference using function.Please provide me with complete funcion definition
which returns by reference in c#.Is there any other way to pass reference? Please help.
How to return by reference using function.Please provide me with complete funcion definition which
Share
With the risk of sounding mean, you should read the C# reference 🙂
C# divides things into reference types and value types. Reference types are as you can imagine, being passed by reference. This means a reference to the object is passed.
Here is a contrived example of return by reference:
Value types are passed by value; although I imagine under the hood something else could be going on. This is not important to you though, only the behaviour is important.
Example of value types:
int,char,Color…You create a reference type through
class, and a value type throughstruct.