What is the difference between ref & out parameters?

Answer Posted / padam

An argument passed as ref must be initialized before passing
to the method whereas out parameter needs not to be
initialized before passing to a method.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a sealed class be used as a base class?

533


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

541


Is c# or c++ better for games?

462


What is the difference between new and override in c#?

552


What is the difference between field and variable in c#?

461






Can you create partial delegates and enumerations?

576


What happens if the inherited interfaces have conflicting method names?

568


Differentiate between object pooling and connection pooling in c#?

539


What is difference between ilist and list in c#?

482


Can constructor be protected?

464


Where is the main method in c#?

526


How do generics work in c#?

482


What exactly happens when we debug and build the program?

2173


What is difference between il and dll ?

524


How do I declare a pure virtual function in c#?

586