title: Use of unassigned local variable (Object)
body: <pre><code>Person tempPerson;
  
  Console.WriteLine("Enter the name of this new person.");
  tempPerson.Name = Convert.ToString(Console.ReadLine());
  
  Console.WriteLine("Now their age.");
  tempPerson.Age = Convert.ToInt32(Console.ReadLine());
  
  peopleList.Add(tempPerson);
  
  RunProgram();
  </code></pre>
  
  <p>At <code>tempPerson.Name</code>, the error list displays "Unassigned use of local variable 'tempPerson'. Below is the class where each Person object is created.</p>
  
  <pre><code>class Person : PersonCreator
  {
      public Person(int initialAge, string initialName)
      {
          initialAge = Age;
          initialName = Name;
      }
      public int Age
      {
          set
          {
              Age = value;
          }
          get
          {
              return Age;
          }
      }
      public string Name
      {
          set
          {
              Name = value;
          }
          get
          {
              return Name;
          }
      }
  }   
  </code></pre>
  
  <p>I don't understand why this is a problem. At tempPerson.Age, there is no problem at all. Running the program with only tempPerson.Age brings no errors. Is there a problem with my Person class?</p>