我写了一些代码,这给了我错误。代码如下:-
long long int compare (const void * a, const void * b)
{
return ( *(long long int*)a - *(long long int*)b );
}
long long int number;
long long int *ar =(long long int *)(malloc(sizeof(long long int)*number));
//Took the values of number and ar from and then performed the following
qsort(ar,number,sizeof(long long int),compare);
此代码导致以下错误:-
invalid conversion from long long int (*)(const void*, const void*)' to int (*)(const void*, const void*) initializing argument 4 of void qsort(void*, size_t, size_t, int (*)(const void*, const void*))'
我在这里做错了什么?