a strange thing
I create a namespace and inside the class there is one function:
public class TEST
public void test(int i)
i = 1;
made it as *.dll, and loaded it into another project:
public class Mytest
public static void Main()
Mytest mytest = new Mytest();
public void test1()
mynamespace.TEST Test = new mynamespace.TEST();
so the output should be 1, wasn't it?
but it was 0, what was wrong?
this was weird :(
There is a basic difference in all programming languages by passing a variable by value ( as you did ) and by reference ( what you wanted to do ).
Passing it by value means your local variable i in the function is a copy of what you gave as parameter. So modifying i does not change the variable given as parameter. By reference means no variable is copied, only a reference to the original variable is given. Changing the reference changes the original variable as you want it in this case.
Look up the in, out and ref keywords in C# for a better understanding of passing by value or by reference.