Witam serdecznie,
napotkałem się po pewnej przerwie od programowania z problemem dotyczącym biblioteki <fstream>,
otóż wpisując linijkę w VS ofstream saving("files/plik.txt"); wyświetla mi błąd, iż " "saving"; identyfikatora nie odnaleziono" i, że "błąd składniowy: brakuje ";" przed identyfikatorem "saving"". Umiałby ktoś to sensownie wytłumaczyć?
kod poniżej z pliku contents.cpp (cały kod jednej klasy), a w book.h mam zawarte #include <fstream>
void timeManagment::createSessionTM() {
system("cls");
int date[3];
int rateOfSessions;
int durationOfSeries;
int durationOfBreaks;
string nameOfSession;
cout << "CREATE SESSION" << endl;
cout << endl;
cout << "Enter name of session: "; cin >> nameOfSession;
cout << "Enter date: "; cin >> date[0] >> date[1] >> date[2];
cout << "Enter number of series: "; cin >> rateOfSessions;
cout << "Enter duration of series: "; cin >> durationOfSeries;
cout << "Enter duration of breaks: "; cin >> durationOfBreaks;
ofstream saving("files/plik.txt"); // błąd
}
dodam jeszcze, że fstream saving działa poprawnie, tylko ten ofstream wykazuje błąd....