title: Dynamically changing a property of a class in C++
body: <p>Working on a console application and I am trying to figure out a way that allows users to enter an object property along with a value. For example</p>
  
  <pre><code>class Box{
      public:
      int height;
      int width;
      int length;
  };
  
  int main(){
      string memberName,value
      cin&gt;&gt;memberName&gt;&gt;value;
  }
  </code></pre>
  
  <p>If a user inputs height, then by using memberName and value how can I change height's value to whatever the user input. I want to make this work so that one can add another class and get the same functionality. </p>
  
  <p>I am considering using maps, but not entirely sure how would I go on doing that. </p>