Hi, i am stuck on this problem - I crawl through an array using ptr++ to save some instructions, and after the deed I need to know how many items I went through.
prints -3 regardless of how many ptr++ I do, which obviously is not right. Any clues how to achieve this?
Rich (BB code):
unsigned char a[20];
unsigned char *ptr;
ptr=a;
ptr++;
ptr++;
int x=(&ptr-&a);
printf("\n%d",x);