I\'m trying to write strcpy on my own using pointers and I get an error during runtime.
void str_cpy(char **destination, const char *source) { // char *s1
For simplicity's sake, this can be done in one line in a function.
void mystrcpy(char *dest, const char *src) { while (*dest++ = *src++); }
This being said, you do need to allocate memory for dest beforehand using malloc or just simply by having a character array like char dest[256].
dest
malloc
char dest[256]