Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void displayPeople(vector<Person> &db, int start, int end)
- {
- for(int i=start, i<end; i++)
- {
- cout << "Förnamn: " << db[i].fNamn << " Efternamn: " << db[i].eNamn << endl;
- }
- }
- void displayDatabase(vector<Person> &db)
- {
- const int increment = 20;
- int start = 0;
- int end = increment;
- char keypress;
- if(db.size() < end)
- {
- displayPeople(db, start, db.size());
- return;
- }
- do
- {
- if(end > db.size())
- {
- displayPeople(db, start, start - db.size());
- break;
- }
- displayPeople(db, start, end);
- start += increment;
- end += increment;
- cout << "Vill du se nästa sida?" << endl;
- cin >> keypress;
- cin.get();
- } while ( keypress == 'y' )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement