Link to home
Start Free TrialLog in
Avatar of IgorStravinsky
IgorStravinsky

asked on

General C++ Question...

Hello experts exchange

I have a C++ program like so:

header1.h
--------- cut
#ifndef FOO1H
#define FOO1H

#include "Foo2.h"
class Foo1
{ void Func (Foo2 *);
};

#endif

--------- end

header2.h
--------- cut
#ifndef FOO2H
#define FOO2H

#include "Foo1.h"
class Foo2
{ void Func (Foo1 *);
};

#endif
--------- end

--------- Then their respective cpp files with function definitions etc...

This is resulting in compiling errors, mainly "Syntax" errors.  Should this happen?  If so, how do I correct  it?  I can get around it by including (essentially) "Foo2.h" in "Foo1.cpp" and then taking a void * parameter instead, but this is messy.  I want a good solution.
ASKER CERTIFIED SOLUTION
Avatar of mozack
mozack

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IgorStravinsky
IgorStravinsky

ASKER

Thanks, that has corrected my problem . I knew there was a way to do it!