This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: using struct
- To: Carlos Camargo <carlos_ivan_camargo at yahoo dot com>
- Subject: Re: [ECOS] using struct
- From: Martin van Veen <martin_van_veen at yahoo dot com>
- Date: Fri, 27 Apr 2001 03:21:15 -0700 (PDT)
- Cc: ecos-discuss at sources dot redhat dot com
Hi Carlos
--- Carlos Camargo <carlos_ivan_camargo@yahoo.com> wrote:
> Can I use struct in ecos?
Sure, why not...
> 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)
You gave the struct a tag, but you didn't declare it. So therefore
the compiler complains (it has nothing to do with eCos). This will
do better, I guess:
struct
{
int a;
} hola;
Greetings,
Martin.
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/