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]
Other format: [Raw text]

Re: problem in ascessing structure member


On Tue, May 11, 2004 at 05:34:15PM +0530, Aravind B wrote:

This has nothing to do with eCos, its a very basic C question.

> void procedureA(cyg_addrword_t data)
> {
> 	str1 s1;
> 	str2 s2;
> 	s1.a='a';
> 	s1.ptr->b=10;

s1.ptr has not been initialised, so you have now overwritten some
random location with 10!

       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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