title: expected primary-expression before ‘const’ errors
body: <p>Please help. I am getting many errors.</p>
  
  <p>sub2.cpp: In function ‘int main()’:
      sub2.cpp:11:14: error: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
      sub2.cpp:12:14: error: invalid conversion from ‘const char*’ to ‘char’ [-fpermissive]
      sub2.cpp:16:17: error: expected primary-expression before ‘const’
      sub2.cpp:16:36: error: expected primary-expression before ‘const’
      sub2.cpp:11:6: warning: unused variable ‘outer’ [-Wunused-variable]
      sub2.cpp:12:6: warning: unused variable ‘inner’ [-Wunused-variable]
      make: <em>*</em> [sub2] Error 1</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  char *Subtract(const char *outer, const char *inner);
  
  int main()
  {
      char outer = "Bookkepper";
  char inner = "keep";
  
  char *word = new char[50];
  
  word = Subtract(const char &amp;outer, const char &amp;inner);
  
  cout &lt;&lt; word &lt;&lt; endl;
  return 0;
  }
  
  
  char *Subtract(const char *outer, const char *inner)
  {
  int olen = strlen(outer);
  int first_occ_idx = -1;
  for(int i=0; i &lt; olen; i++){
      if(strncmp(outer+i, inner,strlen(inner)) == 0){
      first_occ_idx = i;
      }
  }
  if(first_occ_idx == -1){
      return NULL;
  }
  int ilen = strlen(inner);
  int xx = olen - ilen;
  char *newstr = new char[xx];
  int idx = 0;
  for(int i=0; i &lt; first_occ_idx; i++){
      newstr[idx++] = outer[i];
  }
  for(int i=first_occ_idx+ilen; i &lt; olen; i++){
      newstr[idx++] = outer[i];
  }
  newstr[idx] = '\0';
  return newstr;
  }
  </code></pre>