Hello,

I am working on an assignment. I am given the code below. I am trying to figure out what the line directly below is doing. Is this a functor? I am getting a compiler error saying the compiler expects a ';' before the '*'. I've searched for functor examples, but I am stuck. Do I need to define the pointer and/or function? I've tried different combinations, but no luck.

virtual Do_Command * create_Do_Command (int num) = 0;

#ifndef _FOO_FACTORY_H_
#define _FOO_FACTORY_H_

class FOO_Factory
{

public:
    Foo_Factory (void); 
    virtual ~Foo_Factory (void) = 0;

    virtual Do_Command * create_Do_Command (int num) = 0;
    // ...


};


#endif  // !defined _FOO_FACTORY_H_

You haven't declared what the Do_Command type is. You can do this in such a case by adding before the definition of the class FOO_Factory this line:

class Do_Command;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.