Question: in C++, how would I call this method that I wrote to my main .cpp file to remove all of my heroes from the data
in C++, how would I call this method that I wrote to my main .cpp file to remove all of my heroes from the data base? I am confused on if I need to add the counter and everything, and the correct syntax for calling to my method I have created. **disclaimer the code I am sharing here is my code and I wrote it myself, just trying to call my method in main.** void HeroesDB::RemoveAllHeroes(std::string Squad, std::vector
{
int counter = 0;
std::vector
for (Hero NumberOne : _heroes) {
int Compare = isPrefix(Squad.c_str(), NumberOne.Name().c_str());
if (Compare == 0)
{
Superb.push_back(NumberOne);
_heroes.erase(_heroes.begin() +counter);
}
counter++;
}
}
Step by Step Solution
There are 3 Steps involved in it
To call the RemoveAllHeroes method from your main cpp file you need to follow these steps 1 Include ... View full answer
Get step-by-step solutions from verified subject matter experts
