私はあなたの進歩を保存できるゲームを作ろうとしています。 私はすでにこれをやっていましたが、今はもう動作しません。'authlog = myfile'の 'operator ='のあいまいなオーバーロード
エラー:エラーの原因となっている
43: Ambiguous overload for 'operator=' in 'authlog = myfile'
note: candidates are: std::basic_string<_CharT,_Traits,_Alloc>& std::basic_string<_CharT,Traits,..........etc
コード:私の経験で
if (myfile.is_open())
{
while (getline (myfile,line))
{
cout << "You already have a save file!\n";
}
myfile.close();
myfile.clear();
authlog = myfile;
myfile.open("username.txt");
cout << "Enter your username:\n";
cin >> auth;
if(auth == authlog)
{
}
}
'authlog'のタイプは何ですか? – Jiahao
これはエラーを引き起こすコードではありません... authlogコードを提出してください.. – Arvindsinc2
Authlogは文字列ですが、ここには表示されません。 – Loopahnoob