/in/foo.c: In function 'main':
/in/foo.c:8:19: warning: statement with no effect [-Wunused-value]
for(int i=2;i++;i<n+2)
~^~~~
/in/foo.c:6:17: warning: unused variable 'd' [-Wunused-variable]
int n,xi,yi,di,d=0;
^
/in/foo.c: In function 'Search':
/in/foo.c:17:20: error: 'n' undeclared (first use in this function)
for(int i=2;i++;i<n+2)
^
/in/foo.c:17:20: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:19:4: error: 'd' undeclared (first use in this function)
d+=di;
^
/in/foo.c:19:7: error: 'di' undeclared (first use in this function); did you mean 'i'?
d+=di;
^~
i
/in/foo.c:18:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
{ if(xi==sv)
^~
/in/foo.c:20:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
xi=yi;
^~
/in/foo.c:20:7: error: 'yi' undeclared (first use in this function); did you mean 'i'?
xi=yi;
^~
i
/in/foo.c:21:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if(xi==ev) printf("%d",d);break;
^~
/in/foo.c:21:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
if(xi==ev) printf("%d",d);break;
^~~~~
/in/foo.c:22:4: error: 'else' without a previous 'if'
else
^~~~