Problem arrayfind
User gghx
Submission Time 2023-11-23 22:20:16
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp:5:47: error: use of parameter outside function body before ‘]’ token
5 | int higher(int a, int length, int array[length]){
| ^
arrayfind.cpp: In function ‘int higher(...)’:
arrayfind.cpp:6:19: error: ‘length’ was not declared in this scope
6 | int lo = 0, hi = length-1, ans = 0;
| ^~~~~~
arrayfind.cpp:9:11: error: expected unqualified-id before ‘[’ token
9 | if(array[mid] > a){
| ^
arrayfind.cpp:11:4: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
11 | ans = length - mid;
| ^~~
| abs
arrayfind.cpp:16:9: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
16 | return ans;
| ^~~
| abs
arrayfind.cpp: At global scope:
arrayfind.cpp:19:48: error: use of parameter outside function body before ‘]’ token
19 | int smaller(int