foo.cc: In function ‘int main()’:
foo.cc:20:28: error: invalid types ‘bool[int]’ for array subscript
20 | ans[i]=1;
| ^
foo.cc:21:25: error: invalid types ‘bool[int]’ for array subscript
21 | else ans[i]=0;
| ^
foo.cc:23:13: error: expected primary-expression before ‘)’ token
23 | for()
| ^
foo.cc:25:1: error: expected primary-expression before ‘}’ token
25 | }
| ^
foo.cc:24:18: error: expected ‘;’ before ‘}’ token
24 | return 0;
| ^
| ;
25 | }
| ~
foo.cc:25:1: error: expected primary-expression before ‘}’ token
25 | }
| ^
foo.cc:24:18: error: expected ‘)’ before ‘}’ token
24 | return 0;
| ^
| )
25 | }
| ~
foo.cc:23:12: note: to match this ‘(’
23 | for()
| ^
foo.cc:25:1: error: expected primary-expression before ‘}’ token
25 | }
| ^