This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: problem in ascessing structure member
- From: "mohanlal jangir" <mohanlaljangir at hotmail dot com>
- To: "Aravind B" <arvindb at cranessoftware dot com>,<ecos-discuss at sources dot redhat dot com>
- Date: Tue, 11 May 2004 21:25:04 +0530
- Subject: Re: [ECOS] problem in ascessing structure member
- References: <1084277055.3359.9.camel@ambica>
- Reply-to: "mohanlal jangir" <mohanlaljangir at hotmail dot com>
----- Original Message -----
From: "Aravind B" <arvindb@cranessoftware.com>
To: <ecos-discuss@sources.redhat.com>
Sent: Tuesday, May 11, 2004 5:34 PM
Subject: [ECOS] problem in ascessing structure member
> hi,
> I have written a small program contaning 3 structures.
> i am not able to write to structure member b of struct inst using str1.
> i am geeting address out of bounds.
> is there any solution to this.
>
> the program is :
>
> typedef struct{
> short b;
> }inst;
>
> typedef struct{
> char a;
> inst *ptr;
> }str1;
>
> typedef struct{
> char a;
> inst *ptr;
> }str2;
>
> void procedureA(cyg_addrword_t data)
> {
> str1 s1;
> str2 s2;
> s1.a='a';
> s1.ptr->b=10;
?????????????????????????????
s1.ptr is a wild pointer
> printf("%c %c\n",s1.a,s2.a);
> printf("%d %d \n",s1.ptr->b,s2.ptr->b);
> file://printf(" %d = size of \n",sizeof(numbers));
> }
>
> regards.
>
> Aravind B
>
>
>
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss