title: what is the reason of getting this kind of Errors "invalid use of non-static data member "
body: <p>While I'm coding a <strong>Mutator</strong> for class I have got the following <strong>Errors</strong> :<br>
  <em>error1 : invalid use of non-static data member 'MyGraph'</em><br>
  <em>error2 :'MyGraph' is a private member of 'MyGraphBuilder'
  mygraphbuilder.h:51:11: note: declared private here</em>    Can you help me please solve this problem !</p>
  
  <pre><code>// Header file
  class MyGraphBuilder
  {
   private:
    graph_t MyGraph;
  
  // Mutator declared in Header, and Defined in The CPP File
  void setGraph(graph_t);
  
  }; // end of class
  </code></pre>
  
  <p>Definition of the function on cpp file</p>
  
  <pre><code>//This Part only From CPP File not From Header so I added Scope
  void setGraph(graph_tYourGraph){
    MyGraphBuilder::MyGraph = YourGraph;
  }
  // End of Part from CPP File
  </code></pre>