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

What is xml c#?

481


Write the syntax for catching an exception in c#?

484


what class is underneath the sortedlist class?

544


Explain the difference between passing parameters by value and passing parameters by reference with an example?

493


What is the difference between static and constant variables?

536






Differentiate between static class and singleton instance?

512


What is the use of list in c#?

461


What is public or shared assemblies ?

543


Why do we use interfaces in c#?

489


What are methods c#?

480


What are the basics of c#?

544


What does using do in c#?

509


Explain attributes in c#?

477


If I return out of a try/finally in c#, does the code in the finally-clause run?

548


How to reverse each word in a string using c#?

554