title: How can I mark the end of a C string?
body: <p>Here is the code for the function:</p>
  
  <pre><code>void pattern(char word[200], char asPattern[200]) {
      for (unsigned i = 0; i &lt; strlen(word); i++) { // unsigned to remove warning
          if (strchr("aeiou", word[i]) != 0) asPattern[i] = '*';
          else asPattern[i] = '#';
  }
  </code></pre>
  
  <p>Basically this function replaces consonants in word with #'s and vowels with *'s, and stores the new pattern in the asPattern string. However, if I display the asPattern on the screen, it shows the correct pattern followed by a bunch of unknown symbols (strlen(asPattern) equals 211 or something after the for loop). 
  I believe the problem is that the asPattern's end isn't marked and
      asPattern[strlen(asPattern)] = '/0' 
  doesn't work and I don't know what else to do...</p>
  
  <p>I cannot use the std::string, so please bear with me and use C strings.</p>