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
Step: 1
To call the RemoveAllHeroes method from your main cpp file you need to follow these steps 1 Include ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Auditing An International Approach
Authors: Wally J. Smieliauskas, Kathryn Bewley
6th edition
978-0070968295, 9781259087462, 978-0071051415
Students also viewed these Algorithms questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App