Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Widget widget = new Widget(10);
            Console.WriteLine("Widget size (Original Value):   {0}\n", widget.Size);

            processWidget(widget);
            Console.WriteLine("Widget size (After ByVal Call): {0}\n", widget.Size);

            processWidget(ref widget);
            Console.WriteLine("Widget size (After ByRef Call): {0}\n", widget.Size);
        }
Exemplo n.º 2
0
 private static void processWidget(ref Widget widget)
 {
     widget.Size = 20;
 }