Shoud my program look like this: My goal is to call the email addresses from the string to have the users to choose whether they want to list the email address which is number 3
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> addresses;
string str1 = "
[email protected]";
string str2 = "
[email protected]";
string str3 = "
[email protected]";
string str4 = "
[email protected]";
string str5 = "
[email protected]";
string str6 = "
[email protected]";
string str7 = "
[email protected]";
bool processMenu()
{
cout << "1. Enter an email address. " << endl;
cout << "2. Search for an email address. " << endl;
cout << "3. List all email addresses. " << endl;
cout << "4. Delete an email address. " << endl;
cout << "5. Exit. " << endl;
char choice;
cin >> choice;
if(choice == '1'){
cout << "You chose option #1." << endl;
cout << "Please enter the address: ";
string address;
cin>> address;
addresses.push_back(address);
processMenu();
}else if(choice == '2')
{
cout << "You chose option #2." << endl; //Add Stuff Here
processMenu();
cout << "You chose option #3." << endl;
cout << "Listing addresses. " << endl;
for(int i = 0; i << addresses.size(); i++)
{
cout << "Email Address # " << i + 1 << ": " << addresses[i] << endl;
}
processMenu();