Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please let me know the answer in C. Write a function that takes in 6 parameters: a char* array, its size, another char* array, its

Please let me know the answer in C.image text in transcribed

Write a function that takes in 6 parameters: a char* array, its size, another char* array, its size, a char array as the target, and an int array of size 2 ; and performs the following: Find the index of a cstring from the first char* array and the index of another cstring from the second char* array, where those two cstrings will form the target cstring, and put those indexes into the int array. If there are multiple answers, any answer will do. If no answer exists, put the values 1,1 in the int array. Use this function header: void findElements(char* arrA[], unsigned int sizeA, char* arrB[], unsigned int sizeB, char* target, int* result) For example: Given the arrA: { "ch", "a", "A", "cat", "jump", "rep", "c" } and the arrB: {"x3 ", "at", "ch", "ed", "!", "hat" } findElements(arrA, 7 , arrB, 6, "chat", result) should put the values 0,1 in result (6,5 will also work, but not 0, 5) findElements(arrA, 7, arrB, 6, "A!", result) should put the values 2,4 in result findElements(arrA, 7 , arrB, 6, "!A", result) should put the values 1,1 in result findElements(arrA, 7, arrB, 6, "CMPTx3", result) should put the values 1,0 in result for partial match findElements(arrA, 7, arrB, 6, "hat", result) should put the values 1,5 in result for partial match findElements(arrA, 7, arrB, 6, "chach", result) should put the values 1,1 in result because two partial matches with extra characters in-between should not be confused with an exact match findElements(arrA, 7, arrB, 6, "'", result) should put the values 1,1 in result You can assume all elements (cstrings) in the first and second arrays have at least one character and up to 63 characters, and there is no repetition within the same array. Letters are case-sensitive. Only include the function definition (and your helper functions, if any) in the source file and name it as a1_question2.c. Do not use recursion in your

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions