I\'m trying to create my own swap function but I have troubles.
Why I\'m getting \" dereferencing void pointer \" ?
void ft_swap(void *a, void *b, size
You want to cast the (abstract) void* pointer to a pointer to unsigned char so code:
cur_a = (unsigned char *)a + i;
Your code was understood as cur_a = (unsigned char *)(*a) + i; which wrongly dereferences a void* abstract pointer.
BTW, your *a = cur_b; does not make sense neither. Perhaps you want
((unsigned char*)a)[i] = cur_b;