title: Invalid conversion from 'char' to 'const char*'
body: <p>I have a program that generates a single random character, using the <code>randomCharacter</code> function, and random strings, using the <code>randomString</code> function. The latter utilises the former, and <code>breedWithMutation</code> uses <code>randomCharacter</code> to probabilistically mutate a representation of a gene sequence. </p>
  
  <pre><code>#include &lt;ctime&gt;
  #include &lt;boost/random.hpp&gt;
  
  typedef boost::mt19937 randAlgorithm;
  
  int mutationsPerGeneration = 100;
  double probabilityOfMutation = 0.05;
  string potentialAlleles = "abcdefghijklmnopqrstuvwxyz ";
  size_t numberOfAlleles = potentialAlleles.size();
  
  double random01(randAlgorithm &amp; engine)
  {
    boost::uniform_real&lt;double&gt; u01;
    return u01(engine);
  }
  
  int randomInteger(randAlgorithm &amp; engine, size_t min, size_t max) {
    boost::uniform_int&lt;&gt; minmax(min, max);
    return minmax(engine);
  }
  
  string randomCharacter(randAlgorithm &amp; engine, string charSet, size_t charSetSize) {
    return charSet[randomInteger(engine, 0, charSetSize)];
  }
  
  string randomString(randAlgorithm &amp; engine, size_t length, string charSet, size_t charSetSize) {
    string s;
    s.reserve(length);
    for (int i = 0; i &lt; length; i++) {
      s.append(randomCharacter(engine, charSet, charSetSize));
    }
    return s;
  }
  
  string breedWithMutation(randAlgorithm &amp; engine, string originalGenome, size_t genomeSize) {
    string mutatedGenome;
    mutatedGenome.reserve(genomeSize);
    double mutationDraw;
    for (size_t i = 0; i &lt; genomeSize; i++) {
      mutationDraw = random01(engine);
      if (mutationDraw &lt; probabilityOfMutation) { //The allele undergoes mutation
        mutatedGenome.append(randomCharacter(engine, potentialAlleles, numberOfAlleles));
      }
      else {
        mutatedGenome.append(originalGenome[i]);
      }
    }
    return mutatedGenome;
  }
  </code></pre>
  
  <p>However, when I build the application, I get these errors:</p>
  
  <pre><code>    main.cpp: In function ‘std::string randomCharacter(randAlgorithm&amp;, std::string, size_t)’:
  main.cpp:31:55: error: invalid conversion from ‘char’ to ‘const char*’
  main.cpp:31:55: error:   initializing argument 1 of ‘std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT*, const _Alloc&amp;) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;]’
  main.cpp: In function ‘std::string breedWithMutation(randAlgorithm&amp;, std::string, size_t)’:
  main.cpp:53:45: error: invalid conversion from ‘char’ to ‘const char*’
  main.cpp:53:45: error:   initializing argument 1 of ‘std::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; std::basic_string&lt;_CharT, _Traits, _Alloc&gt;::append(const _CharT*) [with _CharT = char, _Traits = std::char_traits&lt;char&gt;, _Alloc = std::allocator&lt;char&gt;, std::basic_string&lt;_CharT, _Traits, _Alloc&gt; = std::basic_string&lt;char&gt;]’
  </code></pre>
  
  <p>The line numbers in the errors don't line up perfectly, I realise, but the first two errors refer to the only line in <code>randomCharacter</code>, and the third and fourth errors refer to this line: <code>mutatedGenome.append(originalGenome[i]);</code> in <code>breedWithMutation</code>. What is causing this error?</p>