//---------------------------------------------------------------------------- // Copyright (C) 2013-2015 Fabrice HARROUET (ENIB) // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, // provided that the above copyright notice appear in all copies and // that both that copyright notice and this permission notice appear // in supporting documentation. // The author makes no representations about the suitability of this // software for any purpose. // It is provided "as is" without express or implied warranty. //---------------------------------------------------------------------------- using System; public class Test { public static void myFunction(int a, ref int b, out int c) { Console.WriteLine("entering myFunction(): a={0}, b={1}, c={2}",a,b,"??"); a+=1; b+=2; c=3333; Console.WriteLine("leaving myFunction(): a={0}, b={1}, c={2}",a,b,c); } public static void Main(string[] args) { int i=100,j=200,k=300; Console.WriteLine("before myFunction(): i={0}, j={1}, k={2}",i,j,k); myFunction(i,ref j,out k); Console.WriteLine("after myFunction(): i={0}, j={1}, k={2}",i,j,k); } } //----------------------------------------------------------------------------