Mixed Unit Tactics C++ help

You need to define the functions correctly:

auto functionName () {
      //whatever was in the function before
}

and execute them correctly:

functionName();

and change all of the this to hero (don’t know why this made a difference)
and change the brackets around ["soldier","archer"] to curvy brackets ( { and } )
and change hero.built.length % summonTypes.length to hero.built.size() % summonTypes.size()
and then change the 'palisade' to "palisade"
and finally change while (true) to int main()
and then there are no more errors I think. But your hero freezes after doing each function once. I think it has something to do with the int main() but I don’t know how to fix it. (c++ is wack)

Also please don’t try to copy other people’s code; just go back to previous levels and learn how to use loops and stuff in c++

Summary
1 Like