It works! Thank you very much for your quick reply! Best regards, Thomas "Dipperstein, Michael" wrote: The statement numptr++ increments a pointer to int. (*numptr)++ increments the value pointed to by numptr. This is the function that you want: void increment(unsigned int *numptr) { (*numptr)++; } -Mike -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Thomas Sent: Thursday, April 01, 2004 1:37 PM To: PICLIST@MITVMA.MIT.EDU Subject: [OT]: Pointer problem! Please help! 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++; } void main (void) { unsigned int num = 1; increment(&num); } --------------------------------- Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads --------------------------------- Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway - Enter today -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads