Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <cstdlib>
- #include <string>
- using namespace std;
- int setup();
- void selectMenu(string Users[],int UserNumbers);
- int Show(string array_1[], int numbers);
- int add(int Us,string array_1[])
- {
- Us++;
- cout<<"Wpisz nazwe ";
- cin>>array_1[Us -1];
- return Us;
- }
- int setup()
- {
- bool SetupDone = false;
- int UserNumber;
- if(SetupDone==false){
- UserNumber = 1;
- SetupDone = true;
- }
- bool IsActive = true;
- return UserNumber;
- }
- int main()
- {
- char wybor;
- int UserNumbers = setup();
- string Users[UserNumbers];
- Users[0] = "Ja";
- cout<<"Users\n"<<endl;
- Show(Users,UserNumbers);
- selectMenu(Users,UserNumbers);
- return 0;
- }
- int Show(string array_1[], int numbers)
- {
- for(int i = 0; i < numbers ; i++)
- {
- cout<<"\n"<<i<<" "<<array_1[i];
- }
- }
- void selectMenu(string Users[],int UserNumbers)
- {
- char wybor;
- cout<<"\n\nWybierz akcje ";
- cin>>wybor;
- if(static_cast<int>(wybor) >= 48 && static_cast<int>(wybor) <= 57)
- {
- switch(static_cast<int>(wybor))
- {
- case(48):
- UserNumbers = add(UserNumbers,Users);
- system("CLS");
- Show(Users,UserNumbers);
- selectMenu(Users,UserNumbers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment