I need help in this question in C program. Consider a 2D array of strings based on the following declarations/definitions:  #define ROWSIZE 4 #define COLSIZE 3 typedef char Str30[31]; Str30 Words[ROWSIZE][COLSIZE]; // 2D array of string An example Words[ ][ ] array is shown below.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I need help in this question in C program.

Consider a 2D array of strings based on the following declarations/definitions: 

#define ROWSIZE 4
#define COLSIZE 3
typedef char Str30[31];
Str30 Words[ROWSIZE][COLSIZE]; // 2D array of string

An example Words[ ][ ] array is shown below.

 

  col0 col1 col2
row0 dOg Neko Cat
row1 Hello gOoDbYE WELCOME
row2 GREEN CauliFlower Blue
row3 Code Programmer SynTaX

: Implement the function void Search(Str30 key, Str30 Words[][COLSIZE], Str30 result, int *pRowIndex, *pColIndex)  where key is the word that we are searching if it is has a match in Words[ ][ ] array.

Coding format -

void Search(Str30 Words[][COLSIZE], Str30 key, Str30 result, int *ptrRowIndex, int *ptrColIndex)
{

// write code here
}

If the key is found, the result parameter is set such that the first character is a + concatenated with the matching word copied verbatim followed by one more +. The values of *pRowIndex and *pColIndex should be set to contain the row index and column index where the key was found in Words[ ][ ] array.If key is not found, the result parameter is set such that the first character is a – followed by the key (copied verbatim) followed by one more –. The values of *pRowIndex and *pColIndex should be set to contain -1 to indicate that the key was not found.
Just like Google search, the Search() function is NOT case sensitive. This means that it does not distinguish between lower and upper case.

For example, the strings “DOG”, “dog”, “Dog”, and “doG” are all considered as the same word.
Example: The following are sample calls and expected output printed via printf(). Assume that variables row and cow were declared as integer variables.
Search(“programmer”, Words, result, &row, &col);
printf(“%s %d %d\n”, result, row, col);                      prints +prOgraMmeR+ 3 1
Search(“green”, Words, result, &row, &col);
printf(“%s %d %d\n”, result, row, col);                       prints +GREEN+ 2 0
Search(”GoodNight”, Words, result, &row, &col);
printf(“%s %d %d\n”, result, row, col);                        prints -GoodNight- -1 -1

Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY