This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
problem in ascessing structure member
- From: Aravind B <arvindb at cranessoftware dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: 11 May 2004 17:34:15 +0530
- 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;
printf("%c %c\n",s1.a,s2.a);
printf("%d %d \n",s1.ptr->b,s2.ptr->b);
//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