title: C++ protecting a private char * of a class
body: <p>I understand the differences of inheritance of public, private, protected with respect to class method / property constucts.  However, my question is specifically associated with pointers to null terminated strings..</p>
  
  <pre><code>class MyClass
  {
     private: 
        char * SomeValue;
  
     ...
     ...
  }
  </code></pre>
  
  <p>Now, somewhere through processing, the MyClass->SomeValue gets allocated and populated with a string value.  No problem.  Now, I want some calling source that has an instance of my "MyClass" object created and needs the string value from this.  Since C++ can do lots of damage with pointers, and pointers to pointers etc,  I want to return the pointer location to the string of chars allocated, but don't want anyone to change values.  Is this default controlled inside the compiler and memory management?  Its a low risk that anyone would be using this class as its primarily for internal purposes, but just more of my understanding.</p>
  
  <p>Thanks</p>