/ Vijos /

记录详情

Compile Error

/in/foo.cc:7:35: error: invalid use of cv-qualified type 'const void' in parameter declaration
 int cmp(const void *a ,const void b)
                                   ^
/in/foo.cc: In function 'int cmp(const void*, <type error>)':
/in/foo.cc:9:13: error: request for member 'fen' in '(aa*)a', which is of pointer type 'aa*' (maybe you meant to use '->' ?)
 if(((aa*)a).fen>((aa)b).fen) return -1;
             ^~~
/in/foo.cc:10:9: error: no matching function for call to 'aa::aa(const void*&)'
 if(((aa)a).fen<((aa)b).fen) return 1;
         ^
/in/foo.cc:4:8: note: candidate: aa::aa()
 struct aa{
        ^~
/in/foo.cc:4:8: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:4:8: note: candidate: constexpr aa::aa(const aa&)
/in/foo.cc:4:8: note:   no known conversion for argument 1 from 'const void*' to 'const aa&'
/in/foo.cc:4:8: note: candidate: constexpr aa::aa(aa&&)
/in/foo.cc:4:8: note:   no known conversion for argument 1 from 'const void*' to 'aa&&'
/in/foo.cc:11:9: error: no matching function for call to 'aa::aa(const void*&)'
 if(((aa)a).hao<((aa)b).hao) return -1;
         ^
/in/foo.cc:4:8: note: candidate: aa::aa()
 struct aa{
        ^~
/in/foo.cc:4:8: note:   candidate expects 0 arguments, 1 provided
/in/foo.cc:4:8: note: candidate: constexpr aa::aa(const aa&)
/in/foo.cc:4:8: note:   no known conversion for argument 1 from 'const void*' to 'const aa&'
/in/foo.cc:4:8: note: candidate: constexpr aa::aa(aa&&)
/in/foo.cc:4:8: note:   no known conversion for argument 1 from 'const void*' to 'aa&&'
/in/foo.cc: In function 'int main()':
/in/foo.cc:19:31: error: cannot convert 'int (*)(const void*, <type error>)' to '__compar_fn_t {aka int (*)(const void*, const void*)}' for argument '4' to 'void qsort(void*, size_t, size_t, __compar_fn_t)'
 qsort(ren,n,sizeof(ren[0]),cmp);
                               ^
/in/foo.cc: In function 'int cmp(const void*, <type error>)':
/in/foo.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
P1813 分数线划定
语言
C++
递交时间
2017-10-20 20:58:53
评测时间
2017-10-20 20:58:53
评测机
分数
0
总耗时
97ms
峰值内存
6.789 MiB