hi, all
I read this programm from one ebook, but i can not under stand how
(a_ptr - a ) return 5 value.
andybody, help me to understand this.Code:#include <stdlib.h> int main() { int a[]={4,8,2,6,1,0,5,2}; int *a_ptr; a_ptr=a; while((*a_ptr)!=0) ++a_ptr; // iterate until 0. printf("%d",a_ptr - a); //this gives the resulte 5. return 0; }
Thanks and regards,
Bhrugu Mehta