진행 상황을 저장할 수있는 게임을 만들려고합니다. 이미이 작업을 수행했지만 작동했지만 이제는 더 이상 작동하지 않습니다.'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