Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
Hi everyone, this code below is coming up break point but supporting its purpose so could you suggest any way to solve break?
void search_by_name() { ifstream file("data.dat", ios::binary); string name; person a; int jump = sizeof(a), endoffile, position,counter=0; file.seekg(0, ios::end); endoffile = file.tellg(); file.seekg(0, ios::beg); position = file.tellg(); cout « "Enter the name : "; cin » name; while (position!=endoffile) { file.seekg(position, ios::beg); while (file.read((char*)&a, sizeof(a))) { if (name == a.getname()) { a.shownum(); counter++; } } position += jump; } if
1 ответ
+ 4
That code sample is not complete, so kind of hard to figure out what is going on. Cheers.