Expected expression before 'int'.
Код:
#include <stdio.h>
#include "lib_sort.h"
#define MAX_OF_INTS 1000
int compare(void* a, void* b)
{
return (*(int*)a > *(int*)b)? 1 : (*(int*)a == *(int*)b)? 0 : -1;
}
int main(void)
{
int i, n;
int a[MAX_OF_INTS];
scanf("%d", &n);
for(i = 0; i < n; i++)
scanf("%d", a+i);
sort(a, a + ((n < MAX_OF_INTS)? n : MAX_OF_INTS), Sizeof(int), compare);
return 0;
}
#include "lib_sort.h"
#define MAX_OF_INTS 1000
int compare(void* a, void* b)
{
return (*(int*)a > *(int*)b)? 1 : (*(int*)a == *(int*)b)? 0 : -1;
}
int main(void)
{
int i, n;
int a[MAX_OF_INTS];
scanf("%d", &n);
for(i = 0; i < n; i++)
scanf("%d", a+i);
sort(a, a + ((n < MAX_OF_INTS)? n : MAX_OF_INTS), Sizeof(int), compare);
return 0;
}
sizeof
С маленькой буквы, в смыле.