12,071,956 members (61,994 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 4:32am
lalitkr1.7K
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 365 Dave Kreskowiak 250 F-ES Sitecore 180 Richard MacCutchan 145 Sascha Lefèvre 140
 Dave Kreskowiak 2,426 OriginalGriff 1,949 Richard MacCutchan 1,675 CPallini 1,222 CHill60 1,219