UPDATE: There is a typo in the above, it should be
void delete_elem(char *arr, size_t n, char *s) {
memmove(s, s+1, n-(s-arr)-1);
}
Type: Posts; User: c99tutorial
UPDATE: There is a typo in the above, it should be
void delete_elem(char *arr, size_t n, char *s) {
memmove(s, s+1, n-(s-arr)-1);
}
This is what "memmove" and strchr, and strrchr are for. strchr and strrchr return a pointer to where a certain character is. So define a delete_elem function to take a pointer argument like this
...