Answer the question
In order to leave comments, you need to log in
How to read a specific line from a file?
Good afternoon. I'm trying to read a certain line from a file.
int set()
{
setlocale(LC_ALL, "");
int password;
string name;
// Создаём объект класса ofstream для записи и связываем его с файлом character_info.xml;
ofstream character_info("character_info.xml");
// Заполним его;
character_info << "[Password] = " << password << ";" << endl;
character_info << "[Username] = " << name << ";" << endl;
// Откроем его только для чтения;
character_info.open("character_infos.xml", ios_base::in);
while (character_info.good())
{
// 13 так как первые 13 символов не учитываем;
password = getline(13, character_info);
}
character_info.close();
return password;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question