Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

not recognizing its own member function...

Status
Not open for further replies.

Vizion01

Programmer
Jun 4, 2003
9
0
0
US
Hi,

I have problem compiling my program. I have the following in one class(A.h) which knows there a class Job:

const Job *getJob() const;

In A.cpp: I defined this member function like this:

Job A::getJob() const { //statement }

I get this compile error:
prototype for `Job A::getJob() const' does not match any in class `Person'

Why isn't it recognize this function in A.cpp? Thanks.
 
In the .cpp you're returning a Job instead of a const Job*.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top