expected type-specifier before error c ++

0

I get an error compiling that I do not understand, I'm implementing the Langton ant using inheritance and polymorphism, by creating a pointer to a class that defines a type of ant with special characteristics.

Estos son los errores que me salen:

error: expected type-specifier before ‘HormigaI’
           Hormiga *a = new HormigaI(ancho,alto);
                            ^
In file included from hormigaI.cpp:2:0:
hormigaI.hpp:7:31: error: expected class-name before ‘{’ token
 class HormigaI: public Hormiga{

This is the code where the first error comes from:

for(int i=0;i<numhormigas;i++){
    Hormiga *a = new HormigaI(ancho,alto);
    vechormigas.push_back(a);
}

Hormiga is the base class and HormigaI is the derived class.

What is causing the second error, referring to that line of code:

class HormigaI: public Hormiga{

Help is appreciated

Thanks

    
asked by AER 11.03.2018 в 21:33
source

0 answers