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: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Date: Fri, 27 Apr 2001 12:18:00 +0200
- Cc: eCos Disuss <ecos-discuss at sourceware dot cygnus dot com>
- References: <20010427095142.33694.qmail@web14003.mail.yahoo.com>
On Fri, Apr 27, 2001 at 02:51:42AM -0700, Carlos Camargo wrote:
> Can I use struct in ecos?
You can use all the standard C constructs.
> I tried to declare a struct inside a thread:
Your syntax is wrong for declaring a struct. In this case hola is the
name of the structure, not the name of the variable. You now need to
use the structure to declare the variable.
I would normally do something link...
struct hola_s {
int a;
};
struct hola_s hola;
This is a C question, not ecos, so you would be better asking
questions on a C mailing list.
Andrew
> static void stimulus( cyg_addrword_t data )
> {
> int i, j;
>
> struct hola{
> int a;
> };
>
> hola.a = 5; // This is 54 line.
> ..
> ..
> }
>
> }