Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <sstream>
- using namespace std;
- struct Pracownik
- {
- int wiek;
- string imie;
- };
- struct Kierowca
- {
- string prawoJ;
- string car;
- Pracownik man;
- };
- struct Sprzedawca
- {
- int hDeal;
- string motto;
- Pracownik man1;
- };
- Sprzedawca dodajS()
- {
- fstream zapisz;
- string temp;
- Sprzedawca s;
- zapisz.open("sprzedawca.txt", fstream::in | fstream::out | fstream::app);
- cout << "IMIE: ";
- cin >> s.man1.imie;
- zapisz << s.man1.imie << endl;
- cout << "WIEK: ";
- cin >> s.man1.wiek;
- zapisz << s.man1.wiek << endl;
- cout << "NAJWIEKSZY KONTRAKT: ";
- cin >> s.hDeal;
- zapisz << s.hDeal << endl;
- cout << "MOTTO: ";
- getline(cin, s.motto); // POMIJA TEN FRAGMENT
- zapisz << s.motto << endl;
- zapisz.seekp(0);
- zapisz.clear();
- zapisz.close();
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement