#include <iostream>
#include <string>
#include "Person.h"
#include "Baseball.h"
usingnamespace std;
int main()
{
// Create a new BaseballPlayer object
BaseballPlayer cJoe;
// Assign it a name (we can do this directly because m_strName is public)
cJoe.m_strName = "Joe";
// Print out the name
cout << cJoe.GetName() << std::endl;
return 0;
}
Baseball.h includes Person.h which includes Baseball.h which includes Person.h which includes ....
get the point?
Two things. Header files should have #include guards around them. Secondly, doing that will yield other compile
errors since you have an #include cycle. From the looks of it, Person.h does not need to include Baseball.h.