12,954,280 members (73,751 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.8K
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
 ppolymorphe 110 OriginalGriff 95 Kornfeld Eliyahu Peter 80 RickZeeland 70 Dave Kreskowiak 68
 OriginalGriff 6,524 CHill60 3,490 Maciej Los 3,123 ppolymorphe 2,030 Jochen Arndt 1,975