Good day. I can not understand. In the program I wrote the function of replacing 2 variables:
static public void change(int x, int y) { int buff = x; x = y; y = buff; }
Further, in the body of the program by clicking on the button:
int x = Convert.ToInt32(textBox1.Text); int y = Convert.ToInt32(textBox2.Text); change(x, y); label1.Text = x.ToString(); label2.Text = y.ToString();
I trace, the function is called, the variables in it are swapped, but then, in the body of the button click, they remain the same. Ie, roughly speaking, the function did not pass the value. What am I doing wrong?