int j=1;
fstream kd("Gydytojai.sed");
while (!kd.eof()) // Checking if the entry already exist;
{ if (gydmas[j].vardas==pgyd.vardas) {ShowMessage(L"Gydytojo id jau egzistuoja");
pagalb=true;}; // if the entry exist, variable pagalb becomes true
j++;};
kd.close();
Well, i'm checking if in the file Gydytojai.sed while it is not end of line checking if my input text, which i compared with the array of structure from file is the same, if it's then pagalb becomes true. And in this thing i get an error of project. File is not empty.