At 01:38 PM 7/11/01 +0100, you wrote: >Given a procedure to read a number of bytes from 16F87x internal >eeprom to a given address : > >void readeeprom(char address,char nbytes,char *dest) >{ >EEADR=address; >EECON1=0; >do { RD=1; *dest++=EEDATA; EEADR++;} while(--nbytes); >} > >The following calls give "illegal conversion of integer to pointer >(warning)" but do generate correct code and work correctly : > >readeeprom(rxbuffer[2],8,&rxbuffer[0]); <---- this should work, if rxbuffer is an array of char >readeeprom(rxbuffer[2],8,(char)&rxbuffer[0]); <---- this is wrong, you don't want to cast the pointer to char! readeeprom(rxbuffer[2],8,(char *) &rxbuffer[0]); <---- this is correct, but I don't know why you would want to write it this way! readeeprom(rxbuffer[2],8,rxbuffer); <---- this is how I would write it IOW:- char rxbuffer[10]; NOT char * rxbuffer[10]; (the latter would be an array of pointers to char) readeeprom(rxbuffer[2],8,rxbuffer); It sounds like the pointer-array duality in C has you snagged, if you persist, all will become clear. Best regadrs, =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads