| www.delorie.com/archives/browse.cgi | search |
| From: | Martin Ambuhl <mambuhl AT earthlink DOT net> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Including Or Not?? |
| Date: | Wed, 13 Jan 1999 05:29:22 -0500 |
| References: | <Pine DOT BSI DOT 3 DOT 96 DOT 990113093654 DOT 840A-100000 AT amos-08 DOT cs DOT huji DOT ac DOT il> |
| X-Posted-Path-Was: | not-for-mail |
| X-Accept-Language: | en |
| X-ELN-Date: | 13 Jan 1999 10:29:32 GMT |
| X-ELN-Insert-Date: | Wed Jan 13 02:35:07 1999 |
| Organization: | Nocturnal Aviation |
| Lines: | 45 |
| Mime-Version: | 1.0 |
| NNTP-Posting-Host: | 1cust7.tnt12.nyc3.da.uu.net |
| Message-ID: | <369C7582.C845C0C1@earthlink.net> |
| X-Mailer: | Mozilla 4.5 [en] (Win95; I) |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
oferco wrote:
>
> Hello:
>
> consider this:
>
> typedef struct {
>
> enum { foo } goo;
>
> } boo;
>
> typedef struct loo {
>
> boo moo;
>
> } roo;
>
> int main() {
>
> roo* noo;
>
> noo->moo.goo = foo;
>
> };
>
> it compiles ok when all of the above is in the same file.
> BUT
> if I have:
> test.h - the typedefs
> thst.c - main and #include "test.h"
>
> the compiler yells - 'foo' undeclared (first use this function)
When I place the typedefs in a separate file, I get no errors other than
the expected one for the illegal ';' after the closing brace and the
warning for the lack of a return value. It seems you have done
something else wrong.
--
Martin Ambuhl (mambuhl AT earthlink DOT net)
Note: mambuhl AT tiac DOT net will soon be inactive
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |