title: Pointer to c++ string
body: <p>in the following code, I am using a pointer to a c++ string in the change() function.</p>
  
  <p>Is there anyway to use the string class' operators when working with a pointer to a string? For example, at() works for the [] operator, but is there any way to use the [] operator?</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  void change(string * s){
  
      s-&gt;at(0) = 't';
      s-&gt;at(1) = 'w';
      // s-&gt;[2] = 'o'; does not work
      // *s[2] = 'o'; does not work
  
  
  }
  
  int main(int argc,char ** argv){
  
      string s1 = "one";
  
      change(&amp;s1);
  
      cout &lt;&lt; s1 &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>