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
What is AutoMapper in C#?
What is data adapter in c#?
Explain the role of Garbage collector and its generations?
if we are updating a database using thread, and mean while application crashes or thread being aborted then what will happen in Database? Rollback or Database will be updated? Please explain with different scenario.
How long can loop recorders stay in?
Can delegates be used as callbacks?
What is dbml file in c#?
What is an inheritance in c#?
Can you pass parameters to destructors?
What is func delegate in c#?
What are constants in c#?
What is reference c#?
Explain a MSIL ? Why is it appreciated by all developers?
What is hierarchical inheritance in c#?
Why generics are used in c#?