Hi everyone, this code below is coming up break point but supporting its purpose so could you suggest any way to solve break? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

5th May 2018, 1:18 PM
Ibrokhim
Ibrokhim - avatar
1 Answer
+ 4
That code sample is not complete, so kind of hard to figure out what is going on. Cheers.
3rd Feb 2020, 1:16 PM
Tony
Tony - avatar