Y
YoYo Pa
I'm new to C#, and wondering how to return multiple values from a method. I
need to have a method return 3 int and 1 string.
thanks
need to have a method return 3 int and 1 string.
thanks
Stoitcho Goutsev (100) said:Hi Yo,
You can either declare that method of yours ot return a structure of those
ints and string or return the result thru method's parameters
public void Foo(out int intParam1, out int intParam2,out int intParam3,out
strung strParam)
{
.....
}
---
HTH
B\rgds
100 [C# MVP]
method.YoYo Pa said:I'm new to C#, and wondering how to return multiple values from aI
need to have a method return 3 int and 1 string.
thanks
YoYo Pa said:Thanks Stoitcho
How does the caller of your sample Foo() method retrieve the output
parameter values? What does that code look like.
-Yo
Stoitcho Goutsev (100) said:Hi Yo,
You can either declare that method of yours ot return a structure of those
ints and string or return the result thru method's parameters
public void Foo(out int intParam1, out int intParam2,out int intParam3,out
strung strParam)
{
.....
}
---
HTH
B\rgds
100 [C# MVP]
method.YoYo Pa said:I'm new to C#, and wondering how to return multiple values from aI
need to have a method return 3 int and 1 string.
thanks