Rog Matthews
Rog Matthews

Reputation: 3247

Create Source file for Header file

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. what should i put in source file i.e. in GetL.cxx

Upvotes: 1

Views: 122

Answers (1)

NPE
NPE

Reputation: 500257

#include "GetL.hxx"

int GetL::getWidth() {
  // your code goes here
}

By the way, having using namespace std; in a header file is not a good practice.

Upvotes: 3

Related Questions