I'm trying to create a contributor class with one enumerated type. I took the member functions from the header and put them in a cpp, but I get an error for the enumerated type when I try to compile. Is it because I haven't written a code body for that member function yet? Files below, header first...oh, I'd also like to ask if everything looks okay so far.
#pragma once
#include <string>
#include <iostream>
using namespace std;
enum gender {male,female,none};
class Contributor
{
public:
Contributor();
Contributor (string Name, double Donation =0.0, gender sex=none, int IDKey=0);
Contributor (const Contributor& InContributor);
~Contributor();
friend ostream& operator << (ostream& out, Contributor& InContributor);
friend istream& operator >> (istream& in, Contributor& InContributor);
Contributor& operator = (const Contributor& rtside);
bool operator < (const Contributor& rtside);
bool operator > (const Contributor& rtside);
bool operator == (const Contributor& rtside);
bool operator != (const Contributor& rtside);
private:
string Name;
double Donation;
int IDKey;
enum gender;
};
Here's the beginning cpp, no function defs yet
#include "Contributor class.h"
Contributor::Contributor()
{
}
Contributor::Contributor (string Name, double Donation, gender sex, int IDKey)
{
}
Contributor::Contributor (const Contributor& InContributor)
{
}
Contributor::~Contributor()
{
}
ostream& operator << (ostream& out, Contributor& InContributor)
{
}
istream& operator >> (istream& in, Contributor& InContributor)
{
}
Contributor& Contributor::operator = (const Contributor& rtside)
{
}
bool Contributor::operator < (const Contributor& rtside)
{
}
bool Contributor::operator > (const Contributor& rtside)
{
}
bool Contributor::operator == (const Contributor& rtside)
{
}
bool Contributor::operator != (const Contributor& rtside)
{
}