(20 points) Reading Strings
Create a program that reads in an array of strings (AKA a 2D array of char). The strings should be read through a
function that reads a single string at a time, assuming the original array still has space. For example, given a 2D array
of char with size 4 \times 32, it can store up to 4 strings of length 31. When you first create the array, there are no
strings. Reading a string using the function should increase the number of strings by 1. If 4 strings have already been
read, the function should not try and read a new string.
Define the following function in a file named string_utils.c with its declaration in string_utils.h. In
string_utils.h, define MAXSTRINGS = 4 and STRSIZE = 32.
(15 points) int read_strings(char [][STRSIZE], int num_strings)
Description Reads a single string, assuming that num_strings < MAXSTRINGS. This function should remove the
ewline, if applicable, from the input string. You can use the trim function defined in utils.c.
Return Value Returns the new number of strings. If the number of strings given by num_strings is equal to
MAXSTRINGS, it will simply return num_strings since no new strings can be read. Otherwise, it will return
num_strings + 1.
(5 points) Testing the Function
Create a file named read_strings.c with a main function. In the function, use a loop to have the user enter up to 4
strings using the function defined above. Once all 4 strings have been read, the program should print them all out.
Remember to compile your program using all code files: gcc read_strings.c string_utils.c utils.c