title: How to make a variable (not class member) "read only" in C#
body: <p>I'm new to the C# world and I can't find a method to declare read only variable in C# (something like declaring "const" variable in c++). Is there one? </p>
  
  <p>I'll give you an example:</p>
  
  <pre><code>...
  int f() { return x; } // x is not const member
  ...
  void g() {
      int readOnlyVar = f(); // is there a method to declare readOnlyVar as read only or const
  
      // Some code in which I want to restrict access to readOnlyVar to read only 
  }
  </code></pre>