title: ERROR: Invalid conversion from 'char' to 'const char'
body: <pre><code>/*This program 
  1. requires user to enter their weight and planet name 
  2.use enum
  3. display error message if listed planet name isn't entered
  */
  
  /*Weight Factors on Each Planet
  Mercury = 0.4155
  Venus = 0.8975
  Earth = 1
  Moon = 0.166
  Mars = 0.3507
  Jupiter = 2.5374
  Saturn = 1.0677
  Uranus = 0
  Neptune = 1.1794
  Pluto = 0.0899
  */
  
  #include&lt;iostream&gt;
  #include&lt;string&gt;
  #include&lt;cctype&gt;
  using namespace std;
  
  enum Planets{MERCURY, VENUS, EARTH, MOON , MARS, JUPITER, SATURN,URANUS, NEPTUNE, PLUTO};
  
  //string array that declares same 10 planets
  string planet[] = {"MERCURY", "VENUS", "EARTH", "MOON", "MARS", "JUPITER", "SATURN", "URANUS", "NEPTUNE", "PLUTO"};
  
  
  //Function Gets the User's Weight
  double getweight()
  {
      double usrweight;
  
      cout&lt;&lt;"\n What is Your Weight on a Different Planet?";
      cout &lt;&lt; "\n Enter Weight(lbs) Here:  ";
      cin &gt;&gt; usrweight;
      return usrweight;
  }
  
  
  //String Function
  string planetlength(string s) 
  {        
      for(int i = 0; i &lt; s.size(); i++)              
       {
       s[i] = planetlength(s[i]);                           
       }
  
       return s;  
  
        /*1. argument variable 's' of type string is passed to function
         2. size() function checks the length of 's' 
         */
  } 
  
  
  //Verifies User selection is valid planet
  int go2planet(string s)                   
  {     
  int found = -1;     
  
  for( int i = 0; i &lt; 10; i++)    //cycle thru 10 planet names 
  {          
  if (s == planet[i])          //if s matches one of the 10 planet names in the array, return planet name as value                    
  found = i;
  }     
  return found; 
  } 
  
  
  
  //Function Selects Planet &amp; Does Arithmetic
  int main()
  {
  int journey;
  int i;
  
  cout&lt;&lt;"\n Take a trip to...";
  
  for (i = 0; i &lt; 10; i++)
  {
  cout&lt;&lt;"-------Planet #--------"&lt;&lt; i+1 &lt;&lt; planet[i];
  }
  
  string decision = planetlength(decision);
  
  cout&lt;&lt;"\n Type in Desired Planet: ";
  cin &gt;&gt; decision;
  
  int destination = go2planet(decision);    
  
  double conversion;    
  
  double myweight = getweight();
  
      switch (journey)   //switch can anly accept integer values to execute in C++
      {
      case MERCURY: 
  
      conversion = (myweight)*(0.4155);
      cout&lt;&lt;"\n On "&lt;&lt; planet[0] &lt;&lt;" You Weigh: "&lt;&lt; conversion &lt;&lt;" lbs.";
          break;
  
  
      case VENUS: 
  
      conversion = (myweight)*0.8975;
          cout&lt;&lt;"\n On"&lt;&lt; planet[1] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt; " lbs";
          break;
  
  
      case EARTH: 
  
      conversion = (myweight)*1.00;
          cout&lt;&lt;"\n On"&lt;&lt; planet[2] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
  
      case MARS: 
  
      conversion = (myweight)*0.3507;
          cout&lt;&lt;"\n On"&lt;&lt; planet[3] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
  
      case MOON: 
  
      conversion = (myweight)*0.166;
          cout&lt;&lt;"\n On"&lt;&lt; planet[4] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
  
      case JUPITER: 
  
      conversion = (myweight)*2.5374;
          cout&lt;&lt;"\n On"&lt;&lt; planet[5] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;"  lbs";
          break;
  
  
      case SATURN: 
  
      conversion = (myweight)*1.0677;
          cout&lt;&lt;"\n On"&lt;&lt; planet[6] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
      case URANUS: 
  
      conversion = (myweight) * 0;
          cout&lt;&lt;"\n On" &lt;&lt; planet[7] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
  
      case NEPTUNE: 
  
      conversion = (myweight)*1.1794;
          cout&lt;&lt;"\n On" &lt;&lt; planet[8] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
  
      case PLUTO: 
      conversion = (myweight)*0.0899;
          cout&lt;&lt;"\n On"&lt;&lt; planet[9] &lt;&lt;"You Weigh:  "&lt;&lt; conversion &lt;&lt;" lbs";
          break;
  
      default: cout &lt;&lt; "\n Not a Valid Planet. Re-Enter Name";
      }
  
      return 0;
      }
  </code></pre>
  
  <p>I used some code I got from a programming class and now I modified it to fit my program. It's one line in the planetlength() function.
  The line: s[i] = planetlength(s[i]); I'm getting an error that now says 'invalid conversion from char to const-char'. I'm using a string array, my function is of type string, and my return value is a string. Where is this hidden char??</p>