title: Member reference base type is not a structure or a union
body: <p>I need some help with a problem I'm having with my homework assignment.</p>
  
  <pre><code>//finds frequency of a sequence in an array (including mutations)
  int find_freq_with_mutations(string target,string sequences[],int sequences_length) {
      for (int i = 0; i &lt; sequences_length; i++) { //goes through each sequence in array
          string current_sequence = sequences[i]; //sets current sequence as a string
          for (int j = 0; j &lt; current_sequence.length(); j++) { //iterate for every character in sequence
              if (current_sequence[j] == current_sequence[j+1]) {
                  current_sequence[j].erase();
              }
          }
      }
      int target_frequency = find_frequency(target, sequences, sequences_length);
  
      return target_frequency;
  
  }
  </code></pre>
  
  <p>The error message is: </p>
  
  <pre><code>DNA_sequencing.cpp:70:24: error: member reference base type
        'std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;,
        std::__1::allocator&lt;char&gt; &gt;::value_type' (aka 'char') is not a structure or
        union
                                  current_sequence[j].erase();
                                  ~~~~~~~~~~~~~~~~~~~^~~~~~
  </code></pre>
  
  <p>Any help is much appreciated!</p>