Question: 1/3 of the methods I need help implementing. As a starting point, iterate through doc->paragraphs[x].lines[y] and use strstr() to test if each line contains the

![point, iterate through doc->paragraphs[x].lines[y] and use strstr() to test if each line](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66df1f8a53eb2_63366df1f89da2b2.jpg)
1/3 of the methods I need help implementing. As a starting point, iterate through doc->paragraphs[x].lines[y] and use strstr() to test if each line contains the target string.
10. int replace_text (Document *doc, const char *target, const char *replacement) The function will replace the text target with the text replacement everywhere it appears in the docu- ment. You can assume the replacement will not generate a line that exceeds the maximum line length; also you can assume the target will not be the empty string The function will return FAILURE if doc, target or replacement are NULL; otherwise the function will return SUCCESS. #de fine DOCUMENT H #de fine MAX PARAGRAPH LINES 20 #de fine MAX PARAGRAPHS 15 #de fine MAX STR SIZE 80 #de fine HIGHLIGHT START STR "[" #define HIGHLIGHT END STR "" #de fine SUCCESS #de fine FAILURE - typedef struct { int number of 1ines: char lines[MAX PARAGRAPH LINES 1 [MAX STR SIZE + 11 \ Paragraph; typedef struct { char name [ MAX STR SIZE+ 11 int number of paragraphs; Paragraph paragraphs [MAX PARAGRAPHS]; } Document
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
