what does it mean my age was not declared in scope?i thought I just needed to declare it in the header file.did I forgot to connect something that does not allow the cpp file to look into the header file?
You forgot to write Person:: in front of the function name so the compiler thinks you're trying to define a regular function that is not part of the class.
1 2 3 4 5 6 7
voidPerson::OutputIdentity(){
}
voidPerson::OutputAge(){
cout<<"i am "<<age<<" years old";
}