Coding help
#1

no

#2
U can only use return once, so u have to write another function returning the other table

#3

Or you can return by reference:

public void swap(ref int a, ref int b)
{
int c = a;
a = b;
b = c;
}
//...
int a = 0, b = 1;
swap(ref a,ref b);
//...

Since in C# every Type is inherited from the base object class you could just return an array of objects:

 

public object[] Swap(int a, int b)
{
return new object[] { b, a };
}
//...
int a = 0, b = 1;
object[] data = Swap(a, b);
a = (int)data[0];
b = (int)data[1];
//...

#4
-.-

#5

-.-

Nice thread necro.



Forum Jump:


Users browsing this thread: