Question: BY USING SYSTEM WORKBENCH FOR STM32 ---------------------------------------------------------------------------------------- Question 4 (20 Marks) Parsing an string from the command line into individual words or tokens make further

BY USING SYSTEM WORKBENCH FOR STM32

----------------------------------------------------------------------------------------

BY USING SYSTEM WORKBENCH FOR STM32 ---------------------------------------------------------------------------------------- Question 4 (20 Marks) Parsing

Question 4 (20 Marks) Parsing an string from the command line into individual words or tokens make further processing easier. The main function already passes the input command line as an array of strings. If a terminal program is being implemented, then the code for this parsing function needs to be written. Given a pointer inp to a NULL terminated character string, a function is required that will return the number of words and update an array of pointers array_of_words_p[] to point to the start of each word in the input string. A word is defined as being separated by one or more spaces. Memory needs to be allocated to store the array of pointers and to store the words Write the function described above that has the following prototype: extern int string-parser (char *inp, char **array-of-words_p [?); The function should be able to cope with zero length strings

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!