title: Unable to Modify struct Members
body: <p>I'm not at all new to programming, but there seems to be a hole in my understanding of C# structs.</p>
  <p>Can anyone explain why the following code prints out the following?</p>
  <blockquote>
  <p>Dist1: 0, Dist2: 0</p>
  </blockquote>
  <pre><code>struct Distance
  {
      public void SetFeet(int feet) { Value = feet; }
      public void SetMiles(float miles) { Value = (int)(miles * 5280f); }
      public int GetFeet() { return Value; }
      public float GetMiles() { return Value / 5280f; }
      private int Value;
  }
  
  class Distances
  {
      public Distance Dist1 { get; set; }
      public Distance Dist2 { get; set; }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          Distances distances = new Distances();
          distances.Dist1.SetFeet(1000);
          distances.Dist2.SetFeet(2000);
  
          Console.WriteLine(&quot;Dist1: {0}, Dist2: {1}&quot;,
              distances.Dist1.GetMiles(),
              distances.Dist2.GetMiles());
  
          Console.ReadLine();
      }
  }
  </code></pre>