With the following code, I keep getting error C2535 when I compile. It's complaining that a member function already defined or declared.
Rationnel.h
...
class Rationnel
{
public:
Rationnel(int); //Constructor
Rationnel(int,int); //Constructor
void add(const Rationnel);
...
Rationnel.cpp
...
//Constructor
Rationnel::Rationnel(int n = 1)
{
numerateur = n;
denominateur = 1;
}
//Constructor
Rationnel::Rationnel(int n = 1, int d = 1)
{
numerateur = n;
denominateur = d;
}
...
Any idea what could be causing the error?
Thanks for your time.