Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace MW71
  8. {
  9.     class Program
  10.     {
  11.         private static void SetOut(out  int value)
  12.         {
  13.             value = 5;
  14.         }
  15.         private static void SetRef(ref  int value)
  16.         {
  17.             value = 6;
  18.         }
  19.         private static void Main(string[] args)
  20.         {
  21.             int valueRef = 0;
  22.             int valueOut;
  23.             SetRef(ref valueRef);
  24.             SetOut(out valueOut);
  25.             Console.WriteLine("REF: " + valueRef);
  26.             Console.WriteLine("OUT: " + valueOut);
  27.             Console.ReadKey();
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement