[Solved] About the “out” prefix of function param in C#


I fixed it for you:

static void Main()
{
    Class1 c1 = new Class1();
    int a=1;
    c1.test(out a); 
}

When calling a function that has an out or ref parameter, you need to pay some respect to that, by marking your parameter as out or ref as well.

MSDN Reference Page

To use an out parameter, both the method definition and the calling method must explicitly use the out keyword.

solved About the “out” prefix of function param in C#