Witam,
Mam problem z VS17 i biblioteką fstram. Oto fragment kodu zawierający błąd:
string path = "levels/" + name;
ofstream file;
file.open(path);
int width;
int height;
if (!file.is_open())
return false;
file >> width >> height;
if (width == 0 || height == 0) {
file.close();
return false;
}
Kompilator wywala mi błąd:
"E0349 żaden operator ">>" nie pasuje do tych argumentów operacji " , a także
"C2678 dwuargumentowy ">>": nie znaleziono żadnego operatora, który przyjmuje lewostronny operand typu "std::ofstream" (lub nie istnieje akceptowalna konwersja)"
Jaki jest błąd w kodzie?
Pozdrawiam,