Here is the code first:
People.cpp
#include "People.h"
#include "Birthday.h"
#include<string>
#include<iostream>
using namespace std;
People::People(string x, Birthday bo)
: name(x), birth(bo)
{
}
void People::People()
{
cout << name << "was born on" << birth.printDate();
}
People.h
#ifndef PEOPLE_H
#define PEOPLE_H
#include<string>
#include "Birthday.h"
class People
{
public:
People(string x, Birthday bo);
void printInfo();
private:
string name;
Birthday birth;
};
#endif // PEOPLE_H
The problem is I get these errors when compling the code:
Compiling: src/People.cpp
In file included from /home/deofamily/Documents/Project/src/People.cpp:1:0:
/home/deofamily/Documents/Project/include/People.h:8:23: error: expected ‘)’ before ‘x’
/home/deofamily/Documents/Project/include/People.h:12:9: error: ‘string’ does not name a type
/home/deofamily/Documents/Project/src/People.cpp:6:15: error: expected constructor, destructor, or type conversion before ‘(’ token
/home/deofamily/Documents/Project/src/People.cpp:11:21: error: return type specification for constructor invalid
/home/deofamily/Documents/Project/src/People.cpp:11:21: error: definition of implicitly-declared ‘People::People()’
What am I doing wrong?