I m looking for how to write a function like memcpy. Method that copy integers or chars from one array to other. What i mean, its to use memcpy, without using it. But in my case it does not work.
void Memcpy( void *from, void *to, int dimension, int length ) {
if(dimension == sizeof(char)){
char *copyFrom = (char *)from;
char *copyTo = (char *)to;
for(int i = length; i < length; i++)
copyTo[i] = copyFrom[i];
}
if(dimension == sizeof(int)){
int *copyFrom = (int *)from;
int *copyTo = (int *)to;
for(int i = length; i < length; i++)
copyTo[i] = copyFrom[i];
}
}
{Thank you for help =)}