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

What is difference between array and list?

485


What is a verbatim string literal and why do we use it?

467


What is default c#?

491


What is difference between comparable and comparator?

450


In .NET how can you solve the DLL Hell problem?

655






What are tuples c#?

491


How is a string immutable?

481


What does private void mean in c#?

528


Difference between a sub and a function in c#.

532


What Is The Smallest Unit Of Execution In .net?

519


How is the syntax written to inherit from a class in C#?Give an example ?

529


What is mvc in c#?

457


What is the difference between final finally and finalize in c#?

442


What is a bool in c#?

464


How do switch statements work?

470