.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

What is ref parameter and where is its uses

Posted By: PankajGupta     Posted Date: August 05, 2009    Points:2   Category :C#
What is ref parameter and where is its uses? Please provide some example.Thank You.

Responses
Author: Venkat             
Posted Date: August 05, 2009     Points: 5   

A parameter declared with a ref modifier is a reference parameter. Unlike a value parameter, a reference parameter does not create a new storage location. Instead, a reference parameter represents the same storage location as the variable given as the argument in the method invocation.

When a formal parameter is a reference parameter, the corresponding argument in a method invocation must consist of the keyword ref followed by a variable-reference of the same type as the formal parameter. A variable must be definitely assigned before it can be passed as a reference parameter.

For Example you can refer this

http://msdn.microsoft.com/en-us/library/aa645763(VS.71).aspx

Mark As Answer if this solve your problem
Warm Regards,
Venkat


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend