05-26-2012, 09:52 AM
no
|
Coding help
|
|
05-26-2012, 09:52 AM
no
05-26-2012, 10:12 AM
U can only use return once, so u have to write another function returning the other table
05-26-2012, 12:57 PM
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]; //...
05-10-2013, 08:21 PM
-.-
05-21-2013, 05:21 AM
-.- Nice thread necro. |
|
« Next Oldest | Next Newest »
|