what is used ref keyword in c#,and how we used it?

Answer Posted / satya

if you want pass parameters by reference then ref keyword
should be used in calling and called methods
void add(ref int x)--- called(formal parameter)
add(ref a)-----calling(actual parameter)
.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c# pass by reference?

686


Is c# int immutable?

694


What is the keyword used to prevent a class from being inherited by another class?

893


Why do we need abstract class?

641


Do loops in c#?

664


explain Garbage collector’s functionality on unmanaged code

704


Is c# easier than javascript?

691


Write a sample code to write the contents to text file in c#?

655


Which is executed if an exception has not occurred?

687


How do I register my code for use by classic com clients?

679


Why c# is type safe?

701


How many root nodes are there in an xml document?

647


What is a nested type. Give an example?

817


Which attribute is used in order that the method can be used as webservice?

712


What is interface used in c#?

753