I get an error when creating an object of a class stating that "Error C2011 'dateType': 'class' type redefinition" I've checked my class multiple times and I don't seem to get my hands on the cause of the error
dateType.h
#include <iostream>;
#include<string>;
using namespace std;
class dateType {
public:
dateType();
~dateType();
void setDate(string, int, int);
void printDate()const;
private:
string day;
int month;
int year;
};
dateType.cpp
#include "dateType.h"
#include<iostream>;
#include <string>;
using namespace std;
dateType::dateType()
{
cout << "please imput day,month,year";
cin >> day >> month >> year;
}
dateType::~dateType()
{
}
void dateType::setDate(string d, int m, int y) {
day = d;
if (m <= 12)month = m;
else { month = 0; year++; }
year = y;
}
void dateType::printDate()const{
cout << "day : \n" << day;
cout << "month : \n" << month;
cout << "year : \n" << year;
}
Thank you.