title: Passing a string to a function in C++
body: <p>I want to pass a string like "Celcius" into a function that I have but I keep getting errors tossed back at me from the Function.</p>
  
  <pre><code>System::Console::WriteLine' : none of the 19 overloads could convert all the argument types
  </code></pre>
  
  <p>I figure I just have something simple wrong.
  Can someone point out my mistake please?  Using MS Visual C++ 2010 </p>
  
  <p>I've posted the offending code.  The other functions (not posted) work fine.</p>
  
  <pre><code>void PrintResult( double result, std::string sType );    // Print result and string
                                                           // to the console
  //=============================================================================================
  //          start of main
  //=============================================================================================
  void main( void )
  {
  ConsoleKeyInfo CFM;
  // Program Title and Description
  
  ProgramDescription();
  
  // Menu Selection and calls to data retrieval/calculation/result Print
  CFM=ChooseFromMenu();
  switch(CFM.KeyChar)    //     ************************************************************
      {                                                                                  //*
          case '1' : PrintResult(F2C(GetTemperature()),"Celsius");                       //*
                   break;                                                                //*
                                                                                         //*
          case '2' : PrintResult(C2F(GetTemperature()),"Fahrenheit");                    //*
                   break;                                                                //*
                                                                                         //*
          default : Console::Write("\n\nSwitch : Case !!!FAILURE!!!");                   //*
      }                       //************************************************************
  
  system("pause");
  
  return;
  }
  //Function
  void PrintResult( double result, std::string sType )
  {
  Console::WriteLine("\n\nThe converted temperature is {0:F2} degrees {1}\n\n",result,sType);
  
  return;
  }
  </code></pre>