/* lead deleteLead(vector <lead> storage)
{
int userAnswer = 0;
cout << "which lead would you like to delete?" << endl;
cin >> userAnswer;
userAnswer -= 1;
storage.erase(storage.begin() + userAnswer);
}
/*lead editLead(vector <lead> storage)
{
cout << "Which lead would you like to edit" << endl;
cin >> userAnswer;
}
*/
1) Please use code tags when posting code, to make it readable.
2) What makes you think there's something wrong with it? What behaviour are you seeing that differs from the behaviour you expect?
We're not mind-readers. If there's a problem, then you have to tell us what it is.
You are mixing char and bool types in the following:
1 2 3 4 5 6 7 8
cin >> x.active;
tolower(x.active); // tolower() of a bool makes no sense
if (x.active == 'y') // makes no sense to compare a bool to 'y'
{ x.active = true;
}
else (x.active == 'n'); // makes no sense to compare a bool to 'n'
{ x.active = false;
}
x.active is a bool. It can only accept a 1 or 0. You can't expect to store character data ('y' or 'n') in it.
edit:
Line 89: storage.size is a function call. It needs ().
for (int i = 0; i < storage.size(); i++)
Line 91: You're using the assignment operator (=), not the equality operator (==).
if (storage[i].active = true)
Line 89,101: The type of i in your for loops should be size_t to avoid a type mismatch.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.