title: accessing struct variable inside getter setter in a c++ class
body: <p>Okay, I have something like this in C++:</p>
  
  <pre><code>class MyClass{
  private:
    int someVariable;
    int someOtherVariable;
  
    struct structName{
      int someStructVariable;
      int someOtherStructVariable;
    };//end of struct
  
  public:
    //getters &amp; setters for the defined variables.
  
    int getSomeStructVariable()
    {
      // this does not work I get this error: "error: expected primary-expression
      // before '.' token"
      return structName.someStructVariable;
    } 
  };//end of class
  </code></pre>
  
  <p>How should I write my getter or setter in this case?</p>