in C++, how would I call this method that I wrote to my main .cpp file to
Fantastic news! We've Found the answer you've been seeking!
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 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++;
}
}
Related Book For
Auditing An International Approach
ISBN: 978-0071051415
6th edition
Authors: Wally J. Smieliauskas, Kathryn Bewley
Posted Date: