This code is wrong in somewhere.Can you help me find out, how to display of any account that i just enter, i just complete in 2 of case , help me in case 2, pls :)
# include <iostream>
using namespace std;
void showdata(string&, string&, int);
int main(){
const int size=20;
string username;
string password;
int choice;
int count=0;
while(choice < 5){
cout << "\t\t PASSWOORD and USERNAME Menu\n\n";
cout << "1. InPUT Data\n";
cout << "2. Display Data\n";
cout << "3. Login\n";
cout << "4. Change PASSWORD\n\n";
cout << "Enter your choice: ";
cin >> choice;
switch (choice)
{
case 1:
cout << " \t\t--------- INPUT-----------\n\n";
cout << " Enter -1 if you want to quit .\n";
// cin >> n
cout << " Enter accounts.\n";
//while (username != "-1"){
//cout << " Username: ";
for(int i=0; i < size; i++){
cout << " Username: ";
cin >> username;
if (username=="-1")
break;
cout << " Password: ";
cin >> password;
count++;
}
break;
case 2:
cout << " \t\t-----------Display----------\n\n";
cout << " This is list of your accout ";
// if(username!="1"){
count = size;
for(int a=0; a< count-2; a++){
cout << username << " - " << password;
//}
}
break;
}
}
return 0;
}