Question: Question #1: Write a function named checkMessages that accepts an array of pointers to C-strings (array of characters with NULL terminating character) and its size.

Question \#1: Write a function named "checkMessages" that accepts an array of pointers to C-strings (array of characters with NULL terminating character) and its size. It checks to see whether the array of messages that contains any message that begins or ends with '-' or has it in the middle of the array. It will return the following three values: - the number of messages that begins with '-' - the number of messages that ends with '-' - the number of messages that begins and ends with '-' Here is an example of test data and its expected return values int main( \{ char msg1[ = "One" "; char msg2[ = "-Two"; char msg3] = "-Three-" ; char msg4[ = "Fou-r" ; char msg5 char = msgSet1[ - Fiv-e" - fmsgi\} ; // with this array, the function will return begins, 0 ends and 0 both. char * msgSetz ={msg1, msg2 };// with this array, the function will return 1 begin, 0 end 0 both char *msgSet3 ={msg1,msg2,msg3};// with this array, the function will return 2 begins, 1 end and 1 both char : msgSet4 ={msg1,msg2,msg3,msg4};// with this array, the function will return 2 begins, 1 end and 1 both char * msgSet5[] - \{msg1, msg2, msg3, msg4, msg5\}; // with this array, the function will return 3 begins, 1 end and 1 both char * msgSet6] = \{msg3\}; // with this array, the function will return 1 begin, 1 end and 1 both 3 return 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
