Passing parameters to methods : Function Parameters : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Function Parameters »

 

Passing parameters to methods








    
 

using System;

class ParameterTest {
    static void SomeFunction(int[] ints, int i) {
        ints[0] = 100;
        i = 100;
    }

    public static void Main() {
        int i = 0;
        int[] ints = { 0, 1, 2, 4, 8 };

        Console.WriteLine("i = " + i);
        Console.WriteLine("ints[0] = " + ints[0]);
        Console.WriteLine("Calling SomeFunction...");

        SomeFunction(ints, i);
        Console.WriteLine("i = " + i);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Function Parameters