Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 Superb)
{
int counter = 0;
std::vector Superb;
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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing An International Approach

Authors: Wally J. Smieliauskas, Kathryn Bewley

6th edition

978-0070968295, 9781259087462, 978-0071051415

More Books

Students also viewed these Algorithms questions

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago