Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!hubcap!grimlok From: grimlok@hubcap.clemson.edu (Mike Percy) Newsgroups: comp.lang.c++ Subject: Re: Is it just me? Problem, need help... Message-ID: <13364@hubcap.clemson.edu> Date: 1 Mar 91 20:11:14 GMT References: <13358@hubcap.clemson.edu> Organization: Clemson University, Clemson, SC Lines: 51 grimlok@hubcap.clemson.edu (Mike Percy) writes: >This is a simplification of a real-code problem. >Any help would be appreciated! >Turbo C++ Version 1.01 Copyright (c) 1990 Borland International >temp.cpp: >Error temp.cpp 10: 'func' is not a member of 'bar' in >function foo::barfunc() >*** 1 errors in Compile *** >-------------------------------------------------------------------- >class bar; >class foo { > bar *barptr; >public: > void barfunc() { barptr->func(); } > void func(); >}; >class bar { > foo *fooptr; >public: > void foofunc() { fooptr->func(); } > void func(); >}; >-------------------------------------------------------------------- > >Is there a way to declare this so that everything works? Thanks to those who helped. (Sound of forehead-smacking!) My solution was to remove the function declarations for barfunc() and foofunc() and insert (after both classes are defined!) inline void foo::barfunc() { barptr->func(); } inline void bar::foofunc() { fooptr->func(); } Taa-daa! "I don't know about your brain, but mine is really...bossy." Mike Percy grimlok@hubcap.clemson.edu ISD, Clemson University mspercy@clemson.BITNET (803)656-3780 mspercy@clemson.clemson.edu