Your class is still not right. The prototype now matches in the main file, but not in the classes.h file. Both files must be consistent throughout, and with each other. Also, you probably will want to use an int for the age, a string will work, however (1) it doesn't do math, and (2) it allows non-numbers to be stored in age.

1) All getters should be const.
That means function such as
int GetAge()
really should be
int GetAge() const

2) Include your class definition before you implement the class.
3) Remove the declarations in the .cpp file. They are global functions with the same name as the class so you don't want them, plus they're not implemented!

Originally Posted by Adak

io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.

Originally Posted by Salem

You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

Why are you declaring a non-class function, that has no implementation, and then also calling a class implementation that has a different return type? And yes 'string &' is different from just 'string'.

Const is neither difficult nor confusing.
Ask yourself these questions?
1) Should this member function change any variables in the class? If no, then make it const. Getter functions are a prime example of functions that should be const.
2) Shall the function that are receiving parameters change them? If no, then make them const. Setter functions are a prime example of these, since they don't change the parameters they receive, they only modify class variables mostly.
3) If the function returns something, should the user be able to modify that data? If no, then make it return const. Getters are a prime example of this, since setting new data is what setters are for.

Some additional rules and thoughts:
- If a function is const, then it cannot return non-const variables (doing so would make the function break its promise that it shall make sure no changes are made to the class variables).
- Const is not needed on parameters that are passed by value since a copy of that value is made anyway.
- Only const functions can be called from inside a const function or on a const object. The reason is that the const function must ensure it does not change any member variables, and by calling a non-const member function, it can do just that. Thus, it's forbidden.

Originally Posted by Adak

io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.

Originally Posted by Salem

You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

Dude, top part? And also you are passing objects in your SetName() function that again, don't exist. I've never seen a user defined function pass in a cin object... You have passed two objects as arguments when your function only accepts one argument.

Code:

player.SetName(cin/*What the hell are you doing with this?*/name); /*Where did you declare this variable?*/