foo.cc: In function ‘int main()’:
foo.cc:7:43: warning: format ‘%c’ expects argument of type ‘char*’, but argument 11 has type ‘int’ [-Wformat=]
7 | scanf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-%c\n",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],b);
| ~^ ~
| | |
| char* int
foo.cc:7:10: warning: ‘b’ is used uninitialized [-Wuninitialized]
7 | scanf("%1d-%1d%1d%1d-%1d%1d%1d%1d%1d-%c\n",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],b);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:6:19: note: ‘b’ was declared here
6 | int a[9];char b;
| ^
foo.cc:17:15: warning: array subscript 9 is above array bounds of ‘int [9]’ [-Warray-bounds=]
17 | if(a[9]-'0'==ans)cout<<"Right";
| ~~~^
foo.cc:6:9: note: while referencing ‘a’
6 | int a[9];char b;
| ^