Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
----------------------------------------------------------------------------------------
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started