<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FLanguage_Basics%2FParameter_Reference</id>
		<title>Csharp/CSharp Tutorial/Language Basics/Parameter Reference - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FLanguage_Basics%2FParameter_Reference"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Language_Basics/Parameter_Reference&amp;action=history"/>
		<updated>2026-04-30T02:27:44Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Language_Basics/Parameter_Reference&amp;diff=6526&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Language_Basics/Parameter_Reference&amp;diff=6526&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Language_Basics/Parameter_Reference&amp;diff=6527&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Language_Basics/Parameter_Reference&amp;diff=6527&amp;oldid=prev"/>
				<updated>2010-05-26T12:19:19Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Objects are passed by reference.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class Test { &lt;br /&gt;
  public int a, b; &lt;br /&gt;
 &lt;br /&gt;
  public Test(int i, int j) { &lt;br /&gt;
    a = i; &lt;br /&gt;
    b = j; &lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
  /* Now, ob.a and ob.b in object &lt;br /&gt;
     used in the call will be changed. */ &lt;br /&gt;
  public void change(Test ob) { &lt;br /&gt;
    ob.a = ob.a + ob.b; &lt;br /&gt;
    ob.b = -ob.b; &lt;br /&gt;
  } &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
class MainClass { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    Test ob = new Test(15, 20); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;ob.a and ob.b before call: &amp;quot; + &lt;br /&gt;
                       ob.a + &amp;quot; &amp;quot; + ob.b); &lt;br /&gt;
 &lt;br /&gt;
    ob.change(ob); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;ob.a and ob.b after call: &amp;quot; + &lt;br /&gt;
                       ob.a + &amp;quot; &amp;quot; + ob.b); &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;ob.a and ob.b before call: 15 20&lt;br /&gt;
ob.a and ob.b after call: 35 -20&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Pass references to methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class MyClass {  &lt;br /&gt;
  int a, b; &lt;br /&gt;
  &lt;br /&gt;
  public MyClass(int i, int j) {  &lt;br /&gt;
    a = i;  &lt;br /&gt;
    b = j;  &lt;br /&gt;
  }  &lt;br /&gt;
  &lt;br /&gt;
  /* Return true if ob contains the same values as the invoking object. */ &lt;br /&gt;
  public bool sameAs(MyClass ob) {  &lt;br /&gt;
    if((ob.a == a) &amp;amp; (ob.b == b)) &lt;br /&gt;
       return true;  &lt;br /&gt;
    else return false;  &lt;br /&gt;
  }  &lt;br /&gt;
 &lt;br /&gt;
  public void copy(MyClass ob) { &lt;br /&gt;
    a = ob.a; &lt;br /&gt;
    b  = ob.b; &lt;br /&gt;
  } &lt;br /&gt;
 &lt;br /&gt;
  public void show() { &lt;br /&gt;
    Console.WriteLine(&amp;quot;a: {0}, b: {1}&amp;quot;, &lt;br /&gt;
                      a, b); &lt;br /&gt;
  } &lt;br /&gt;
}  &lt;br /&gt;
  &lt;br /&gt;
class MainClass {  &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    MyClass ob1 = new MyClass(4, 5);  &lt;br /&gt;
    MyClass ob2 = new MyClass(6, 7);  &lt;br /&gt;
  &lt;br /&gt;
    Console.Write(&amp;quot;ob1: &amp;quot;); &lt;br /&gt;
    ob1.show(); &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(&amp;quot;ob2: &amp;quot;); &lt;br /&gt;
    ob2.show(); &lt;br /&gt;
 &lt;br /&gt;
    if(ob1.sameAs(ob2))  &lt;br /&gt;
      Console.WriteLine(&amp;quot;ob1 and ob2 have the same values.&amp;quot;); &lt;br /&gt;
    else &lt;br /&gt;
      Console.WriteLine(&amp;quot;ob1 and ob2 have different values.&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(); &lt;br /&gt;
 &lt;br /&gt;
    // now, make ob1 a copy of ob2 &lt;br /&gt;
    ob1.copy(ob2); &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(&amp;quot;ob1 after copy: &amp;quot;); &lt;br /&gt;
    ob1.show(); &lt;br /&gt;
 &lt;br /&gt;
    if(ob1.sameAs(ob2))  &lt;br /&gt;
      Console.WriteLine(&amp;quot;ob1 and ob2 have the same values.&amp;quot;); &lt;br /&gt;
    else &lt;br /&gt;
      Console.WriteLine(&amp;quot;ob1 and ob2 have different values.&amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
  }  &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;ob1: a: 4, b: 5&lt;br /&gt;
ob2: a: 6, b: 7&lt;br /&gt;
ob1 and ob2 have different values.&lt;br /&gt;
ob1 after copy: a: 6, b: 7&lt;br /&gt;
ob1 and ob2 have the same values.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use ref to pass an int value type by reference==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class RefTest { &lt;br /&gt;
  /* This method changes its argument. &lt;br /&gt;
     Notice the use of ref. */ &lt;br /&gt;
  public void sqr(ref int i) { &lt;br /&gt;
    i = i * i; &lt;br /&gt;
  } &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
class MainClass { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    RefTest ob = new RefTest(); &lt;br /&gt;
 &lt;br /&gt;
    int a = 10; &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;a before call: &amp;quot; + a); &lt;br /&gt;
 &lt;br /&gt;
    ob.sqr(ref a); // notice the use of ref &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine(&amp;quot;a after call: &amp;quot; + a); &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;a before call: 10&lt;br /&gt;
a after call: 100&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>