friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:11:18: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
11 | S[i]=S[host[i]];
| ~~~~~~~~~^
friend.cpp:6:9: note: while referencing 'S'
6 | int S[]={}; S[0]=1;
| ^
friend.cpp:11:7: warning: array subscript i is outside array bounds of 'int [0]' [-Warray-bounds]
11 | S[i]=S[host[i]];
| ~~~^
friend.cpp:6:9: note: while referencing 'S'
6 | int S[]={}; S[0]=1;
| ^
friend.cpp:9:20: warning: array subscript <unknown> is outside array bounds of 'int [0]' [-Warray-bounds]
9 | S[i]=3-S[host[i]];
| ~~~~~~~~~^
friend.cpp:6:9: note: while referencing 'S'
6 | int S[]={}; S[0]=1;
| ^
friend.cpp:9:7: warning: array subscript i is outside array bounds of 'int [0]' [-Warray-bounds]
9 | S[i]=3-S[host[i]];
| ~~~^
friend.cpp:6:9: note: while referencing 'S'
6 | int S[]={}; S[0]=1;
| ^
friend.cpp:16:10: warning: array subscript i is outside array bounds of 'int [0]' [-Warray-bounds]
16 | if (S[i]==1){
| ~~~^
friend.cpp:6:9: note: while referencing 'S'
6 | int S[]={}; S[0]=1;
| ^