This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: using struct


...and if you read my last post, you will probably understand
that I have been too much into C++ lately.

The answer to you question is of course that in C, you cannot
leave out the keyword "struct" from your variable declaration.

You code should look like this:

   struct hola_type {
      int a;
    };

    struct hola_type hola;
    hola.a = 5; // This is 54 line.

But still, this is a C question, not eCos.

/Linus


> Hi all.
> 
> A simple question:
> 
> Can I use struct in ecos?
> 
> I tried to declare a struct inside a thread:
> 
> static void stimulus( cyg_addrword_t data )
> {
>     int i, j;
>  
>    struct hola{
>       int a;
>     };
> 
>     hola.a = 5; // This is 54 line.
> 	..
> 	..    
>     }
>  
> }
> 
> and i have the following error message:
> sync_mbox.c:54: `hola' undeclared (first use in this
> function)
> 
> Thanks
> 
> Best regards..
> 
> Carlos Camargo
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]