#include "GuestList.h" #include #include /* * GästeListe * * Konsoleninput zur Wahl Liste verlängern/ausgeben/Ende */ void showMenu() { std::cout << "1 to add Guest" << std::endl << "2 to print all Guests" << std::endl << "0 to exit" << std::endl; } void getInput(int &input) { std::cin >> input; } void printAllInVector(std::vector &Myvector) { for (std::string name : Myvector) { std::cout << name << std::endl; } } void Aufg2Main() { std::vector guestList; while (true) { showMenu(); int input; getInput(input); std::string name; switch (input) { case 0: return; case 1: std::cin >> name; guestList.push_back(name); break; case 2: printAllInVector(guestList); default: break; } } }