Problem lunchbox
User ansellee
Submission Time 2023-12-26 17:02:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

lunchbox.cpp:4:30: error: ‘voidb’ does not name a type; did you mean ‘void’?
4 | int cmp (const void a, const voidb){
| ^~~~~
| void
lunchbox.cpp:4:21: error: invalid use of cv-qualified type ‘const void’ in parameter declaration
4 | int cmp (const void a, const voidb){
| ~~~~~~~~~~~^
lunchbox.cpp: In function ‘int cmp(<type error>, int)’:
lunchbox.cpp:5:29: error: ‘b’ was not declared in this scope
5 | return ((int) a - (int) b);
| ^
lunchbox.cpp: In function ‘int main()’:
lunchbox.cpp:15:30: error: cannot convert ‘int (*)(<type error>, int)’ to ‘__compar_fn_t’ {aka ‘int (*)(const void*, const void*)’}
15 | qsort(k, m, sizeof(int), cmp);
| ^~~
| |
| int (*)(<type error>, int)