daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void searchFIO() {
  2.     char len[30];
  3.     int p = 0;
  4.     FILE *f;
  5.     fopen_s(&f,"rabochiy.dat", "rb");
  6.     if (!f) {
  7.         printf("Файл не найден\n");
  8.         system("pause");
  9.     }
  10.     printf("Введите фамилию и инициалы\n");
  11.     fflush(stdin);
  12.     gets_s(len);
  13.     gets_s(len);//если 2012 студия закоменть один gets
  14.     long k;
  15.     k = (_filelength(_fileno(f))) / (sizeof(rabochiy));
  16.     for (int i = 0; i < k; i++) {
  17.         if ((fread(&st, sizeof(rabochiy), 1, f)) &&(strcmp(len, st.FIO) == 0)) {
  18.             p++;
  19.         }
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top