void fman::update(ul ln_num, constchar* str)
{
//ul is a typedef for unsigned int, fio is fstream error_check works //corretly
if (!error_check(fio))
return;
fio.seekg(0, std::ios_base::beg);
fio>>_ln_num_w;
eatline(fio);
if (ln_num > _ln_num_w || ln_num < 0)
{
std::cout<<"\nline number exceddes the number of lines";
return;
}
ul i = 0;
while (true)
{
if (i == ln_num){break;}
eatline(fio);
fio.get();
fio>>i;
}
fio.get();
fio.get();
for (ul j = 0;j < strlen(str);j++)
{
fio<<str[j];
if (fio.get() == ')')
break;
}
}
here is eatline
1 2 3 4 5
void fman::eatline(std::fstream &_fio)
{
while (_fio.get() != '\n')
continue;
}