Hi,
been programming all day long, and tryed to compile my program, everything is fine, except some kind of nonsense with ofstream..
These are the problems, and i don't know why ofstream says such things, because in my other programs everything is fine with seekg, or tellg, and everything else which here is a problem
pro1.cpp: In function ‘void issaugoti(irasas*, int&)’:
pro1.cpp:140: error: no matching function for call to ‘std::basic_ofstream<char, std::char_traits<char> >::open()’
/usr/include/c++/4.4/fstream:696: note: candidates are: void std::basic_ofstream<_CharT, _Traits>::open(const char*, std::_Ios_Openmode) [with _CharT = char, _Traits = std::char_traits<char>]
pro1.cpp:142: error: ‘struct std::ofstream’ has no member named ‘seekg’
pro1.cpp:148: error: ‘struct std::ofstream’ has no member named ‘tellg’
Function in which are these problems:
void issaugoti (irasas * issaugomas, int &kiekis)
{
string sPB;
bd(sPB);
ofstream osB(sPB.c_str());
if (osB.open())
{
osB.seekg(0, ios::end);
time_t sek = time(0);
tm *t = localtime(&sek);
for (int i = 0; i < kiekis+1; i++)
{
int data = t->tm_year + t->tm_mon + t->tm_mday + t->tm_hour + t->tm_min + t->tm_sec;
issaugomas[i].sDBID = sPB.c_str + osB.tellg() + data; //tellg pasako vietą, nuo kur reikia skaityti duomenis
osB << issaugomas[i].sDBID << endl;
osB << issaugomas[i].sAG << endl;
osB << issaugomas[i].sP << endl;
osB << issaugomas[i].sZ << endl;
osB << issaugomas[i].sIM << endl;
osB << issaugomas[i].sI << endl;
osB << data;
}
kiekis = 0;
osB.close();
}
else
{
cout << "Klaida: byla " << sPB << " negali būti atidaryta" << endl;
}
}