「Celcius」のような文字列を関数に渡したいのですが、関数からエラーが返され続けます。
System::Console::WriteLine' : none of the 19 overloads could convert all the argument types
単純な問題があるだけだと思います。誰かが私の間違いを指摘できますか?MS Visual C++ 2010 の使用
問題のあるコードを投稿しました。他の機能(掲載されていません)は正常に動作します。
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;
}