Question
3 String Search Develop a C program that searches a le for a given string. Your program should Ask the user to enter the le
3 String Search Develop a C program that searches a le for a given string. Your program should Ask the user to enter the le to be searched. Ask the user to enter the target string. The string can be longer than one word, but no longer than a line. Locate the target string in the le. Your program should be able to identify the target string as a part of another string. You are not allowed to call the strstr function for this part, you have to implement your own. Print the line number as well as the entire line for every match. 1 Sample execution: File input: Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only ve centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Target word: si Output: 1. Lorem Ipsum is simply dummy text of the printing and typesetting industry. 2. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, 3. recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Note that in your output, the matching text need not be red.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started