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 Garbage Collection in .Net?
What are the applications of c#?
How long does it take to learn c# for unity?
Is a games console a computer?
Can you instantiate a struct without using a new operator in c#?
Why does my windows application pop up a console window every time I run it?
Does c# support #define for defining global constants?
What is c-sharp (c#)?
What is data binding c#?
What is the main method in c#?
How can I check the type of an object at runtime?
Why to use “finally” block in c#?
Can we customize the serialization process?
What is using directive in c#?
What are the types of methods in c#?