Forward declaration issue (error: previous declaration of 'tst' was here)
Baurzhan Ismagulov
ibr@radix50.net
Thu Dec 4 15:58:00 GMT 2008
On Thu, Dec 04, 2008 at 07:24:35AM -0800, Hani Ayoub wrote:
> Anyway... I've tried to compile the same code on g++ (instead of gcc), and I
> got no error :)
> Don't really know why...
Because C++ allows it.
> >> What I'm trying to do is "forward declaration"; means to hide tst struct
> >> definition from source or header files that includes tst2.h file.
...
> but works fine...
Except that you haven't achieved your goal of hiding the tst struct from
its users. But if you can use C++, you'd probably want to use classes.
With kind regards,
--
Baurzhan Ismagulov
http://www.kz-easy.com/
More information about the Gcc-help
mailing list