deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
#include <stdio.h> /* Function to remove a word from a sentence */ char *remove_word(char *s1, const char *s2) { if (*s2 != '\0') { char *dst, *src, *p; const char *q; dst = src = s1; while (*src != '\0') { for (p = src, q = s2; *q != '\0' && *p == *q; p++, q++) continue; if (*q == '\0') { src = p; /* the word was found, skip it */ } else { *dst++ = *src++; /* otherwise, copy this character */ } } *dst = '\0'; /* put the null terminator if the string was shortened */ } return s1; } char *input(char buf[], size_t size) { size_t i; if (!fgets(buf, size, stdin)) return NULL; for (i = 0; buf[i]; i++) { if (buf[i] == '\n') { buf[i] = '\0'; break; } } return buf; }