----- Original Message ----- From: Niklas Lvvgren To: Sent: Tuesday, February 26, 2002 2:48 PM Subject: SV: [pic]:struct+pointer > is that true!? yes. > doesn't it point constantly at something that itself doesn't have to be > constant? no, "ship * const p;" does. Try repositioning the const and then doing p = &ship1; the compiler should complain. > /niklas Regards Sergio -----Ursprungligt meddelande----- Fren: Sergio Masci [mailto:smpl@NTLWORLD.COM] Skickat: den 26 februari 2002 14:59 Till: PICLIST@MITVMA.MIT.EDU Dmne: Re: [pic]:struct+pointer > > > > > cost ship * p; > > is this cost actually const? > > You can read from but not write to a const location. > const meens constant, unchanging. Declaring a const > pointer meens that it points to something which must > not be changed. > > > > p=&ship1; > > > (*p).temperature=123; > > > the error message is same. > > > > p->temperature > > > > > > > > Why??? > > Regards > Sergio -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads