I've been writing a code using fstream to create a file having a specific number, now I want mmy program to check whenever a new entry is being made if the name of that entry has already been used or not, TIA for all your help. I've tried doing it myself as in the code attached, but I'm not sure if it's working properly. The aim is to check if the file has already been made if so and error would be given otherwise the user would be prompted to continue on making the new file.
cout<<"Enter your NIC or Form B number: ";
cin.ignore();
gets(det.nic);
entries.open(det.nic, ios::out);
if (!entries)
{
cout<<setw(70)<<"\nYou've already availed the fund!\n";
system("pause");
system("cls");
goto m;
}
else
{