i have inline c swap function for sorting an array but in the compile time it gives error that swap reference is undefined. by removing the swap it works; what is wrong with code
inline void swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}
void sort(int ar[])
{
int length = sizeof(ar) / sizeof(int);
for(int i = 0; i < length; i++)
{
for(int j = i; j < length; j++)
{
if(ar[j] < ar[i])
{
swap(&ar[j], &ar[i]);
}
}
}
}