char *copy(char *dest, const char *src, int capacity) {
// dest is the starting memory address to be filled
// capacity is already the number of bytes
int j = 0;
int* i = &j; //declare i as a pointer so we can access it after for loop

for(*i = 0; *i < capacity/sizeof(char); i++){
    memset(&(dest[*i]), src[*i], 1); //copy each string exactly once
}
// now let's add the null pointer
memset(&(dest[*i+1]), '\0', 1);
    return dest;
}

The function copy should copy as many characters in src into dest as indicated by capacity, but it should add a null terminator at the end