title: Is it good practice to make member variables protected?
body: <p>Asking this question because I feel that member variables of my base will be needed later <strong>in derived classes</strong>. Is there a drawback of making them protected?</p>
  
  <p>EDIT: Edited to better show my intention.</p>
  
  <p>EDIT: @sbi : Is this also wrong?</p>
  
  <p>This class will be used for error recording and retrieving in other classes. Is it better to derive from it or use an object of it - I don't know. But I think the getter and setter methods are what this class is all about. </p>
  
  <pre><code>class ErrorLogger
  {
     public:
        //Making this function virtual is optional
        virtual void SetError(const char*, ...);
        const char* GetError() const;
     protected:
        char* z_ErrorBuf;
  };
  </code></pre>