title: Using for_each with tolower()
body: <p>I am trying to use the STL function for_each to convert a string into lower case and I have no idea what I am doing wrong. Here's the for_each line in question:</p>
  
  <p><code>clean = for_each(temp.begin(), temp.end(), low);</code></p>
  
  <p>Where temp is a string that is holding a string. And here's the function that I wrote for low:</p>
  
  <pre><code>void low(char&amp; x)
  {
  x = tolower(x);
  }
  </code></pre>
  
  <p>And the compiler error that I keep getting is as such:</p>
  
  <pre><code>error: invalid conversion from void (*)(char&amp;) to char [-fpermissive]
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>EDIT:
  Here is the whole function that I am writing:</p>
  
  <pre><code>void clean_entry (const string&amp; orig, string&amp; clean)
  {
  string temp;
  int beginit, endit;
  
  beginit = find_if(orig.begin(), orig.end(), alnum) - orig.begin();
  endit = find_if(orig.begin()+beginit, orig.end(), notalnum) - orig.begin();
  
  temp = orig.substr(beginit, endit - beginit);
  
  clean = for_each(temp.begin(), temp.end(), low);
  }
  </code></pre>