Why don't my changes to dest remain in main?
char *copy(char *dest, const char *src, int capacity) {
    dest = malloc(sizeof(char) * capacity);
    memset(dest, '\0', capacity);
    for(int i = 0; i < (capacity - 1); i++){
        dest[i] = src[i];
    }
    return dest;
}