View Single Post
Old May 26th, 2006, 7:07 AM   #4
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,253
Rep Power: 5 grumpy will become famous soon enough
Yes, it is possible to implement your design in C++.

It is not necessary to post your complete program. It would help if you took your class and cut it down to a small but complete example that (most importantly) exhibits your problem. The process of creating that example may make it clear to you what the problem is (i.e. you might succeed in solving it without help). If not, by providing complete information, we have more chance of helping. It also helps if you tell us what error message you're getting from your compiler (or linker).

From the information you've given, you shouldn't need to use the "this->" prefix when calling goo() within foo(). The most likely causes of your error that I can think of (noting that you haven't provided enough information) are;

1) foo() is static (in which case there is no "this" pointer when called)

2) you have mixed up return types or argument types of the functions in some way that introduces an incompatibility.
grumpy is offline   Reply With Quote