What is difference between out and ref in c#?
Answer / Gaurav Agrawal
In C#, both 'out' and 'ref' are used to pass variables by reference. However, a variable declared with 'out' must be explicitly assigned before it leaves the function, while a variable declared with 'ref' can have its initial value passed into the function, or it can be initialized within the function itself.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can you create sealed abstract class in c#?
What is an iqueryable in c#?
Can a struct have a default constructor (a constructor without parameters) or a destructor in c#?
What is mvc pattern in c#?
How to find out that the code is written as managed or un-managed code?
Explain the functionalities of satellite assembly?
What is function and method in c#?
What is the use of protected in c#?
what are the different ways to cleaning up objects?
What is difference between virtual and override in c#?
what is IEquatable
why do we use Overloading, Overriding, Boxing, Unboxing, and what is the use of these ?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)