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


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.
> 	..
> 	..    
>     }
>  
> }


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