title: Loop does not work properly
body: <p><strong>I'm not asking to code for me!</strong> Just explain me why infinite loop does not loop=)</p>
  
  <pre><code>static void Main()
  {
    int i=1;
    while (i&gt;0)
    {
      using (StreamWriter writer = new StreamWriter("O:\\out.txt"))
      {       
        Console.SetOut(writer); 
        Act();            
      }
    }
  }
  
  
  static void Act()
  {
  
      Process process = Process.GetProcessesByName("notepad")[0]; 
      IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, process.Id); 
  
      int bytesRead = 0;
      byte[] buffer = new byte[8]; 
  
      ReadProcessMemory((int)processHandle, 0x002BAAD0, buffer, buffer.Length, ref bytesRead);
  
      Console.WriteLine("&lt;bytes&gt;" + Encoding.Unicode.GetString(buffer) + "&lt;/bytes&gt;");
  }
  </code></pre>
  
  <p><code>Main</code> writes to a specific file console's output calling <code>Act</code>. The program runs once. Make sense, right? </p>
  
  <p>To make an infinite loop I add:</p>
  
  <p><code>int=1
   while (i&gt;0) {}</code></p>
  
  <p>...loop. <code>Act()</code> action is <strong>INSIDE</strong> the loop, so why does <code>Main</code> run infinitely but <code>Act</code> still runs once?</p>