vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:5:5: error: 'h' was not declared in this scope
h=H;
^
vision.cpp:6:5: error: 'w' was not declared in this scope
w=W;
^
vision.cpp:11:10: error: 'to' was not declared in this scope
int j=to(k,i);
^~
vision.cpp:11:10: note: suggested alternative: 'tm'
int j=to(k,i);
^~
tm
vision.cpp:18:1: error: expected '}' before 'else'
else x2=k;
^~~~
vision.cpp:15:3: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
if(i==1)
^
vision.cpp:20:1: error: expected ';' before '}' token
}
^
vision.cpp:7:13: warning: unused variable 'y' [-Wunused-variable]
int ind=0,x,y,x2,y2;
^
vision.cpp:7:18: warning: unused variable 'y2' [-Wunused-variable]
int ind=0,x,y,x2,y2;
^~
vision.cpp: At global scope:
vision.cpp:23:1: error: expected unqualified-id before 'if'
if(ind==1)
^~
vision.cpp:25:5: error: 'ind' does not name a type; did you mean 'int'?
ind=0;
^~~
int
vision.cpp:26:1: error: expected unqualified-id before 'for'
for(int k=1;k<=W;k++){
^~~
vision.cpp:26:13: error: 'k' does not name a type
for(int k=1;k<=W;k++){
^
vision.cpp:26:18: error: 'k' does not name a type
for(int k=1;k<=W;k++){
^
vision.cpp:41:1: error: expected unqualified-id before 'if'
if(ind==1)
^~
vision.cpp:43:13: error: 'x' was not declared in this scope
int p=abs(x-x1)+abs(y-y1);
^
vision.cpp:43:15: error: 'x1' was not declared in this scope
int p=abs(x-x1)+abs(y-y1);
^~
vision.cpp:43:15: note: suggested alternative: 'y1'
int p=abs(x-x1)+abs(y-y1);
^~
y1
vision.cpp:43:23: error: 'y' was not declared in this scope
int p=abs(x-x1)+abs(y-y1);
^
vision.cpp:44:3: error: expected unqualified-id before 'if'
if(p==k){
^~
vision.cpp:49:1: error: expected declaration before '}' token
}
^