Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void fpunktV(ifstream& g1, ifstream& g2, ofstream& f)
- {
- Podpischiki a;
- Podpiska b;
- PunktV c;
- int i, l, k, s, j;
- while (g1.peek() != EOF)
- {
- g1.read((char*)&a, sizeof(Podpischiki));
- g2.seekg(0);
- k = 0;
- while (g2.peek() != EOF)
- {
- g2.read((char*)&b, sizeof(Podpiska));
- if (strcmp(a.surname, b.snamepod) == 0)
- {
- l = strlen(a.country);
- for (i = 0; i < l; i++)
- {
- c.countryV[i] = a.country[i];
- }
- c.countryV[l] = '\0';
- c.indexV = a.index;
- s = strlen(b.nizdaniepod);
- for (i = 0; i < s; i++)
- {
- c.vseizd[k][i] = b.nizdaniepod[i];
- }
- c.vseizd[k][s] = '\0';
- k++;
- }
- }
- for (j = k; j < 50; j++)
- {
- c.vseizd[j][0] = '\0';
- }
- f.write((char*)&c, sizeof(PunktV));
- }
- }
- void showV(ifstream& f)
- {
- PunktV a;
- while (f.peek() != EOF)
- {
- f.read((char*)&a, sizeof(PunktV));
- cout << a.countryV << " " << a.indexV << " ";
- for (int i = 0; i < 50 && a.vseizd[i][0] != '\0'; i++)
- {
- cout << a.vseizd[i]<<" ";
- }
- cout << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement