Hi,
I am trying to implement abstract factory in c++, but i encountered one problem that compiler doesn't allows me to this:

class Temp
{
virtual void dr=0; //error is in this line


};

it says illegal use of type void !!
i can use other return types but i want to know whats wrong with this .

TIA

Recommended Answers

All 4 Replies

dr isn't a member function...there's a lot more wrong here than void.

class Temp{
 virtual void dr() = 0;
};
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.