Be more descriptive. Which is the undeclared indentifier? hour and minute? If that's the case, you haven't defined them in your class or failed to include the header file, possibly.
class Time
{
public:
Time(); //constructor
Time(int, int); //constructor with parameters
void setHour(int);
void setMinute(int);
int getHour();
int getMinute();
void printTime();
private:
int hr;
int min;
};
There is the problem...in the class, you define two ints: hr and min, and yet in the constructor you use hour and minute.
EDIT: Oh wait, I see what you did, and it's wrong. Don't declare the constructor's parameters to have the same name as members of the class; that just "hides" them unless you use this-> to explicitly reference the member variables.
You have "hr" and "min" in your class.
You also have two parameters to your constructor called "hr" and "min".
In your constructor, you assign to both "hr" and "min".
Since you have pairs of variables, each named "hr" and "min", the compiler has to decide which one you are referring to. In this case, it assigns to the parameters, accomplishing nothing for you since the class's variables are left unchanged.