title: Cannot overload functions distinguished by return type alone C++
body: <p>Hi I am working on a school project and have written all of this code from scratch (very simple I know). I am a bit confused, as I have solved all errors but two, and was wondering if someone could take a look over my source code and inform me of what I might be doing wrong, and how to solve it. Thanks!</p>
  <p>Here are the errors</p>
  <blockquote>
  <p>IntelliSense: cannot overload functions distinguished by return type alone</p>
  <p>IntelliSense: no suitable conversion function from &quot;std::string&quot; to &quot;double&quot; exists</p>
  </blockquote>
  <p>And my source code.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  //Global Constants
  const double BMI_FACTOR = 703;
  const double MASS_LOWER_LIMIT = 18.5;
  const double MASS_UPPER_LIMIT = 25.0;
  
  //Function Prototypes
  double getWeight();
  double getHeight();
  double setMass(double, double);
  string setOverUnder(double);
  void showBMI(string, double);
  
  //Begin Main
  int main() {
  
      //Variable Declaration
      double weight;
      double height;
      double BMI; //Body Mass Index
      string healthStatus; //Either Optimal, Under, or Over-weight
  
      //Get the user's weight
      weight = getWeight();
  
      //Get the user's height
      height = getHeight();
  
      //Calculate the user's BMI
      BMI = setMass(weight, height);
  
      //Determine the user's health status based on BMI
      healthStatus = setOverUnder(BMI);
  
      //Displays the user's BMI and health status
      showBMI(healthStatus, BMI);
  
      return 0;
  
  //End Main
  }
  
  //Function getWeight
  double getWeight() {
  
      //Local Variable Declaration
      double totalWeight;
  
      //User Input for Weight
      cout &lt;&lt; &quot;Enter weight in pounds.&quot; &lt;&lt; endl;
      cin &gt;&gt; totalWeight;
  
      //Return the value for totalWeight to caller
      return totalWeight;
  
  //End Function getWeight
  }
  
  //Function getHeight
  double getHeight() {
  
      //Local Variable Declaration
      double totalHeight;
  
      //User Input for Height
      cout &lt;&lt; &quot;Enter height in inches.&quot; &lt;&lt; endl;
      cin &gt;&gt; totalHeight;
  
      //Return the value for totalHeight to caller
      return totalHeight;
  
  //End Function getHeight
  }
  
  //Function setMass
  double setMass(double localVarWeight, double localVarHeight) {
  
      //Local Variable Declaration
      double totalMass;
  
      //Calculate the user's BMI
      totalMass = (localVarWeight * BMI_FACTOR) / (localVarHeight * localVarHeight);
  
      //Return the value of totalMass to the caller
      return totalMass;
  
  //End Function setMass
  }
  
  //Function setOverUnder
  double setOverUnder(double localVarMass) {
  
      //Local Variable Declaration
      string wellBeing;
  
      //Determine user's health
      if (localVarMass &lt; MASS_LOWER_LIMIT)
          wellBeing = string(&quot;underweight.&quot;);
      else if (localVarMass &gt; MASS_UPPER_LIMIT)
          wellBeing = string(&quot;overweight.&quot;);
      else
          wellBeing = string(&quot;optimal weight.&quot;);
      
      //Return the value of wellBeing to the caller
      return wellBeing;
  
  //End Function setOverUnder
  }
  
  //Function showBMI
  void showBMI(string localVarHealth, double localVarMass) {
  
      //Display user's BMI
      cout &lt;&lt; &quot;Your BMI is &quot; &lt;&lt; localVarMass &lt;&lt; endl;
  
      //Display user's health status
      cout &lt;&lt; &quot;You are &quot; &lt;&lt; localVarHealth &lt;&lt; endl;
  
  //End Function showBMI
  }
  </code></pre>