1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
My code seems pretty solid. I don't understand how to call ask for some reason.
template <typename T>
void ask() {
string choice;
string parameter;
T target;
int exitcheck = 0;
list * question = new list();
list * answer = new list();
question = read();
answer = question;
while (exitcheck == 0) {
cout << "What would you like to search for? (options are: fname, lname, ssn, dob, title, address, town, state, zip, exit, print, clear, save)\n";
cin >> choice;
if (choice != "exit" && choice != "print" && choice != "clear" && choice != "save") {
cout << "What paramater would you like to work with? (options are: equal, begin)\n";
cin >> parameter;
cout << "Please state your target\n";
cin >> target;
answer = search(answer, choice, parameter, target);
} else if (choice == "exit") {
exitcheck = 1;
} else if (choice == "print") {
answer->print();
} else if (choice == "clear") {
answer = question;
} else if (choice == "save") {
ofstream fout;
fout << "answer.txt";
}
}
}
void main () {
ask();
}
|