title: How to iterate through variable members of a class C++
body: <p>I'm currently trying to do a complicated variable correction to a bunch of variables (based on normalizing in various phase spaces) for some data that I'm reading in. Since each correction follows the same process, I was wondering if there would be anyway to do this iteratively rather than handle each variable by itself (since I need to this for about 18-20 variables). Can C++ handle this? I was told by someone to try this in python but I feel like it could be done in C++ in some way... I'm just hitting a wall!</p>
  
  <p>To give you an idea, given something like:</p>
  
  <pre><code>class VariableClass{
      public :
        //each object of this class represents an event for this particlular data set 
        //containing the following variables
        double x;
        double y;
        double z;
  }
  </code></pre>
  
  <p>I want to do something along the lines of:</p>
  
  <pre><code>for (int i=0; i &lt; num_variables; i++)
  {
     for (int j=0; j &lt; num_events; j++)
     {
       //iterate through events
     }
     //correct variable here, then move on to next one
  }
  </code></pre>
  
  <p>Thanks in advance for any advice!!!</p>