title: Accessing the values of an enum defined in a struct
body: <p>The <strong>struct</strong> is as follows:</p>
  
  <pre><code>struct padData 
  {
      enum buttonsAndAxes
      {
          select,
          start,
          ps
      };
  };
  </code></pre>
  
  <p>The object of the <strong>struct</strong>:</p>
  
  <pre><code>padData        pad;
  </code></pre>
  
  <p>I am accessing this enum as follows:</p>
  
  <pre><code>printf ("\n%d", pad.buttonsAndAxes[0]);
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>error: invalid use of ‘enum padData::buttonsAndAxes’
  </code></pre>
  
  <p>Then, I tried:</p>
  
  <pre><code>printf ("\n%d", pad::buttonsAndAxes[0]);
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>error: ‘pad’ is not a class or namespace
  </code></pre>
  
  <p>Now what? Please guide.</p>
  
  <p>Compiler: <strong>gcc version 4.5.0</strong></p>
  
  <p><em><strong>EDIT 1:</em></strong>_<em><strong></em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__<em>_</em>__</strong></p>
  
  <pre><code>printf ("\nemit: %d", padData::(select)0);
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>error: expected unqualified-id before ‘(’ token
  </code></pre>
  
  <p><strong>My aim is to fetch the word "select" through its value 0. How to achieve that? Also, is the word "select" a string?</strong></p>