Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include int main(void) { int i; char line1[80], line2[80]; void readLine(char buffer[]); printf(Type in string to be searched (up to 80 characters):); for (i =

#include

int main(void)

{

int i;

char line1[80], line2[80];

void readLine(char

buffer[]);

printf("Type in string to be searched (up to 80 characters):");

for (i = 0; i < 3; ++i)

{

readLine(line1);

}

printf("Type in string to be found (up to 80 characters):");

for (i = 0; i < 3; ++i)

{

readLine(line2);

}

return 0;

}

void readLine(char buffer[])

{

char character;

int i = 0;

do

{

character = getchar();

buffer[i] = character;

++i;

} while (character != ' ');

buffer[i - 1] = '\0';

}

This is my code so far, I now want to have the string in line2 be searched in the string in line1 and then make a new string containing all the words from line2 that were found in line 1. for example if line 1 was hello world my name is c and line2 was my name is, then the new string would contain my name is

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

What is a prototype?

Answered: 1 week ago

Question

LO 9-2 How do we see colors?

Answered: 1 week ago

Question

Know why employees turn to unions

Answered: 1 week ago

Question

Understand the process of effective succession planning

Answered: 1 week ago

Question

Understand the history of unionization

Answered: 1 week ago