> Hello, > > I am using MCC18 with 18F452 MCU. I have this very simple > pointer program but it doesn't seem to work correctly. For some > reason, the variable "num" doesn't get incremented at all. Did I > do something wrong? > > void increment(unsigned int *numptr) > { > numptr++; > } This increments that value of numptr, not the value of the object pointed to by numptr. Try this instead: (*numptr)++; TTYL ---------------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads