swap function
template <class T> void swap ( T& a, T& b )
{
T c(a); a=b; b=c;
}
And a=&c[0]; b=&d[0]; after swap(a,b);
a will pointing to d[0]
b will pointing to c[0]
and swap(&c[0],&d[0]); the prototype does not correspond to the existing swap function.
The necessary prototype is
swap(int*,int*)
so there is no matching function to call so the compiler throws error.