|
From: Carlos d. M. <cg...@wo...> - 2002-11-15 11:26:45
|
Write tfunction declaration first
class Function{
...
};
struct Tal{
...
};
If there is some reason for you need struct first than function you can
write:
class Function;
struct Tal{
...
};
Function{
...
};
So when the compiler sees that pointer inside Tal it knows yet about the
existence of the class Function.
Bjorn Terelius escribi=F3:
> When compiling a program containing the following code I get a syntax
> error at the line Function* f; struct Tal
> {
> Function* f;
> // some stuff}; class Function
> {
> public:
> // some more stuff
> private:
> Tal* first;
> }; I assume it is because the compiler doesn't recognize Function as a
> class. Is that correct? How should I write the code? Thanks for any
> helpBj=F6rn
>
>
> -----------------------------------------------------------------------
> MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
> ------------------------------------------------------- This sf.net
> email is sponsored by: To learn the basics of securing your web site
> with SSL, click here to get a FREE TRIAL of a Thawte Server
> Certificate: http://www.gothawte.com/rd524.html
> _______________________________________________ Dev-cpp-users mailing
> list Dev...@li... TO UNSUBSCRIBE:
> http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|