I have a file GetL.hxx
#ifndef GetL_included
#define GetL_included
#include <iostream>
using namespace std;
class GetL
{
public:
virtual int getWidth();
};
#endif //GetL_include
Here the class GetL contains only one virtual function and thus is a abstract class. How can i create .cxx file for this .hxx file?
This is not an abstract class. An abstract class contains a pure virtual function. For example , if you wanted to make your class abstract you could put
virtual int getWidth() = 0;which would force thegetWidth()function to be defined in a derived class.It’s probably also worth mentioning that it’s not a good idea to put
usingstatements in a header file. It pollutes the current namespace unnecessarily and can lead to naming conflicts.