13,197,200 members (57,054 online)
Rate this:
See more:
what is te meaning of the ref in nd Out with some practical explanation ? and an example
Posted 20-Aug-12 3:32am
lalitkr1.9K
ryanb31 20-Aug-12 10:51am

What language?

Rate this:

## Solution 3

ref- use to pass by reference in function argument
out-similar to ref but pass out value from the function..below example

```class Test
{
void refDemo(ref int i)
{
i= i*10;
}
int FindDecimal(float f,out float dp)
{
int i=(int) f;
dp=f-i;
return i;
}
}

class RefExample
{
public statc void Main(string []args)
{
Test obj=new Test();
int i=10;
Console.WriteLine("Before Call i:" + i);
obj.refDemo(ref i);
Console.WriteLine("After Call i:" + i);
obj.FindDecimal(12.2345f,out float f);
Console.WriteLine("Decimal points f:" + f);
}
}```
v2
Rate this:

## Solution 4

I suggest you read a little bit C# because this question would mean you need some basics covered before jumping to implementation.

Here is a very good crash course link. this will also answer your question and cover other basic details too.

Quick C#[^]
Manas Bhardwaj 21-Aug-12 9:15am

Well said +5
Rate this:

## Solution 1

Don't flood the boards. Buy a book. This is basic stuff, and has NOTHING to do with ASp.NET, nor can we give an example in the language you're using if you don't tell us, but either way, you're asking us to do stuff you can do for yourself. Type your questions in to google. Buy a book. Don't expect us to do it all for you.

Top Experts
Last 24hrsThis month
 OriginalGriff 470 Karthik Bangalore 235 CPallini 125 Dave Kreskowiak 100 Peter_in_2780 90
 OriginalGriff 7,035 ppolymorphe 1,699 Karthik Bangalore 1,663 CPallini 1,090 Jochen Arndt 1,045