Copy An Array

We can use this pattern to copy an array

int* int_copy(int *dest, const int *source, int length) {
  int *pDest = dest;
  
  for (int i = 0; i < length; i++) {
    *pDest++ = *source++;
  }

  return dest;
}

Also see: Retrieve array length