-1
私はC++プログラムを実装していますので、プロジェクト上の理由から1つのファイルに変換する必要がありますので、通常は別のヘッダファイルに入れることはできません。私のファイル コンストラクタの一部ヘッダー次のようになります:予期しないエラーID - わからない理由(C++)
class OrderOfOps {
public:
// Constructor
OrderOfOps(const std::string& in);
private:
std::string m_inString;
};
問題エリア:私はここに
project1.cpp:194:12: error: expected unqualified-id
OrderOfOps(const std::string& in)
^
project1.cpp:194:12: error: expected ')'
project1.cpp:194:11: note: to match this '('
OrderOfOps(const std::string& in)
は、問題のコードの行です。このエラーを取得してい
bool IsNumber(const std::string& num)
{
std::string::const_iterator it = num.begin();
// Look up locale method
while (it != num.end() && std::isdigit(*it, std::locale())) {
++it;
}
return !num.empty() && it == num.end();
}
// Constructor
OrderOfOps(const std::string& in)
{
m_inString = in;
}
エラーを再現するように[MCVE]を提供してください。 –
'OrderOfOps :: OrderOfOps(const std :: string&in)'を試してください。 – songyuanyao
@songyuanyao wow。私はとてもばかげている。私はそれをキャッチしていないとは思わない。ありがとう。 –