title: How to dynamically call property names in C++ like square bracket notation in JS?
body: <p>My first language is Javascript, but I'm starting to learn C++. One of my favorite things to do is access properties with clever variable property names using square bracket notation in Javascript like so:</p>
  
  <pre><code>var a = "prop";
  var obj = {
    this.prop : "before"
  };
  function alterObj(a){
    obj[a] = "after";
  }
  </code></pre>
  
  <p>It doesn't seem to be coming up in my C++ books, and I'm having trouble Googling it. So how does one dynamically select property names in C++?</p>