title: A nonstatic member reference must be relative to a specific object Singleton class C++
body: <p>I have a singleton class. I would like to assign a value to a structure member. But the compiler throwing an error as <code>A nonstatic member reference must be relative to a specific object</code>.
  Please help me, how to solve the same.</p>
  
  <pre><code>class abc{
  
      static abc* m_selfInst;
  public:
  
      struct abcd{
          int a;
      }abcd;
  
  abc* GetInstance();
  };
  
  abc* abc::m_selfInst = NULL;
  
  abc* abc::GetInstance()
  {
      if(m_selfInst == NULL)
      {
          m_selfInst = new abc();
      }
      return m_selfInst;
  }
  int main()
  {
      abc *ab = abc::GetInstance(); //Error Occurs here
      abc::abcd.a = 5; //Error occurs here too
      //cout &lt;&lt;ab.abcd.a &lt;&lt; "\n";
  
      return 0;
  }
  </code></pre>