Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PruebaSwap
- {
- static void Swap(ref string a, ref string b)
- {
- string temp = a;
- a = b;
- b = temp;
- }
- static void Main()
- {
- string x = "Juan";
- string y = "Oliva";
- Swap(ref x, ref y);
- Console.WriteLine(x); // Oliva
- Console.WriteLine(y); // Juan
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement