// //Main.cpp // #include using namespace std; #include "Person.h" int main(){ Person P(25, "Bob"); } // //Person.cpp // #include "Person.h" #include using namespace std; #include Person::Person(int age1, string name1) : name(name1), age(age1) //Error on age: "'age' is not a nonstatic data member or base class of class 'Person'" { } void Person::DisplayFacts(){ cout << name << "'s age is " << age << endl; //Same error here when accessing age. } Person::~Person(void){ } // //Person.h // #ifndef Person_H #define Person_H #pragma once #include using namespace std; #include class Person{ public: Person(int age1, std::string name1); ~Person(void); void DisplayFacts(void) private: int age; string name; }; #endif