what is reference parameter?
what is out parameters?
what is difference these two?

Answer Posted / sarun p.t

out is used only to get output from a function.
it means that we cannot give any input using an out
parameter. Whatever value we assign to an out parameter
before calling to a function will be worthless, we need to
assign a value in the called function to our out parameter
before its first usage and if no usage we need to assign a
value before control leave the function.(out can be passed
to function while uninitialized)

ref parameter is used for both input and output. The only
thing is we need to assign a value before its first usage.
ref parameter must be initialized before passing to a
function.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find methods of a assembly file (not using ILDASM)?

641


What is the use of ispostback in c#?

470


Explain About friend and Protected friend

519


How does one compare strings in c#?

543


what are the differences between a class and structure

542






What is constructors, explain with syntax

547


What is the major difference between a custom control and user control?

556


What is native image generator (ngen.exe)?

653


To whom a method is accesssed if it is marked as protected internal ?

610


what class is underneath the sortedlist class?

551


What is the syntax for calling an overloaded constructor within a constructor (this() and constructorname() does not compile)?

521


Define constructor in c#.

511


What is expression tree with example?

487


Why do we need oops in c#?

476


What is the name of c# compiler?

630