Question: #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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!