What is the value of expression *(p+i) in function f() in the following code:
When I debugged the code, after first if-else statement, if statement is passed and else is executed.Code:#include<stdio.h> float m[4][4]={{1.5,2.5,3.5},{3,4.5,5.5},{5,6.5,7.5}}; void f(float *p, int m, int n) { int i, b1=0, b2, s=0; for (i=m, b2=b1; i<=n; s+=*p, i++) if (*(p+i)) b1++; else ++b2; printf("%d %d %d %f", b1, b2, s,p[i]); } int main() { f(&m[1][2],1,9); return 0; }
So, how the value of *(p+i) is 0?
Thanks for replies.