help with *void

i got this exercise and i wrote this code.
[IMG]http://img42.imageshack.us/img42/8331/37255827.png[/IMG]
i have a problem with the bubblesort part becouse it thinkes it's void pointer. i don't think i nedd to write the program 8 times there must be a way
tnx a million

You already know the size of each element in the form of num_of_byte. First alter your swap macro to accept a byte count which will be passed to memcpy. Then replace your comparison (which is comparing the address of two pointers) with a predicate function that compares values. Look to qsort for an example of how this kind of interface works.

rafi1082

8 Years Ago

thanks for your reply
but even if know the number of byte doesn't the signed\unsigned makes it much more complicated?
how will the function be able to compare? it has 8 options.
about the swap i'l try to change it.
if you can help me in anything else...
tnx again