title: Iterating over a struct in C++
body: <p>I have a structure</p>
  
  <pre><code>typedef struct A
  {
      int a;
      int b;
      char * c;
  }aA;
  </code></pre>
  
  <p>I want to iterate over each an every member of the structure and print its value. Something like:</p>
  
  <pre><code>void print_struct_value(struct *A)
  {
      for each member of struct A
      cout &lt;&lt; "struct name . member name" &lt;&lt; "value";
  }
  </code></pre>
  
  <p>How can this be done in C++ ??</p>