Re: Forward declaration issue (error: previous declaration of 'tst' was here)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux