Mail Archives: djgpp/1999/02/09/15:17:32
"Jorge Ivan Meza Martinez" <jimeza AT usa DOT net> wrote:
> I am trying to make a graph class, I must make two classes
>
> * graph nodes
> * graph pathes ( relations between nodes )
>
> a node has a value and an array of graph pathes, and,
> a node path has a weight and a pointer to a graph node.
>
> I made both classes and in the headers I put:
>
> "ifndef __GraphNode_h_
> #define __GraphNode_h_"
>
> to prevent loop includes.
>
> But I can't make this class - inside - other - than - has - a - reference -
> to - the - first work,
> compiler says that a class is not known in the other's class when the header
> is included and
> the source file is in the project.
>
> Sorry if it is a little confused, if anyone can help me please tell me and
> I will send you my code, is very short for see my problem.
A mess ...
Let me see: You have:
class A
{
... reference to class B ...
};
class B
{
....reference to class A ...
};
problem? (the chiken and the egg ;-)
If that's your problem use
class B;
class A
{
... reference to class B ...
};
In the header where class A is declared and:
class A;
class B
{
....reference to class A ...
};
In the header where class B is declared.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://welcome.to/SetSoft
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -