I’m making a function which receives array of any datatype and reverse it elements.
void f(void *p, int size)
{
for(int i=0; i<=size/2; i++)
{
swap(p+i, p+size-i-1);
}
}
but problem is how can i implement swap function which swap their content without dereferencing void pointers?
Or you could use the std::reverse function