title: Trouble accessing private members from my class header in my cpp file C++
body: <h3>"Morg.h"</h3>
  
  <pre><code>class Morg{
      public:
          void setName( std::string morgName );
          void setType( char morgType );
          void setXcoord( int xLocation );
          void setYcoord( int yLocation );
          void moveMorg( int currDirection );
          void consume( Morg morg );
          void reproduce( char morgType );
          void setBounds( int upperBound );
          void setDirection( int currDirection );
          char getType();
  
      private:
          std::string Name;
          char Type;
          int yCoord;
          int xCoord;
          int bounds;
          int direction;
  };
  </code></pre>
  
  <h3>"Morg.cpp"</h3>
  
  <pre><code>#include "masterIncludes.h"
  // The above has a bunch of std stuff like list and iostream ect.
  #include "Morg.h"
  
  
  void setName( std::string morgName ){
      Name = morgName; //I get an error here. it thinks `Name` is undefined.
                       //I've tried `Morg::Name` and it stays undefined.
                       // I dont know what im supposed to do.
  }
  std::string getName(){
      return Name;
  }
  void setType( char morgType ){}
  void setXcoord( int xLocation ){}
  void setYcoord( int yLocation ){}
  void moveMorg( int currDirection ){}
  void consume( Morg morg ){}
  void reproduce( char morgType ){}
  void setBounds( int upperBound ){}
  void setDirection( int currDirection ){}
  char getType(){}
  </code></pre>
  
  <p>I get errors when trying to get and set the Name or anything else because it says its undefined, I thought I was supposed to use the header to avoid that so I am wondering where I am going wrong.</p>
  
  <p>BTW: I'm using MS Visual Studio 2012.</p>