So I'm implementing a simple test class and such I'm separating files into : compte.h:
#ifndef COMPTE_H
#define COMPTE_H
#include <iostream>
class compte
{
public:
static int n;
int numCompte;
char* nom;
double solde;
public:
compte(const char* = NULL, const double & = 0);
~compte();
};
and a compte.cpp
#include <iostream>
#include <cstring>
#include "compte.h"
using namespace std;
int compte::n = 1000;
compte::compte(const char* nom, const double &solde)
{
this->solde = solde;
this->nom = new char[strlen(nom)];
strcpy(this->nom, nom);
numCompte = n++;
}
compte::~compte()
{
delete[] nom;
}
however, when I include compte.h I get an unidentified reference to the member methods of the class, when I include compte.cpp it works, I just want to know what I can add to include the .h file instead of .cpp