Question: use c++ language to solve this question Advanced cstring function (write this function after lab and turn it in at the next lab for 10
use c++ language to solve this question Advanced cstring function (write this function after lab and turn it in at the next lab for 10 bonus point on the first exam) One last function for you to implement. Again, I will provide an overview of the algorithm, but I will not provide you with an implementation from me. You will need to write and test this function to get full credit. strtok): strtok0 provides you with a different substring found in the original cstring parsed by a delimit character Each time you call strtok) the next substring is returned. We will write a different version of strtok). Our version will return an array of cstrings that is terminated with a value of NULL. Each string found prior to the NULL value will point back into the original cstring. The returned array needs to be dynamically allocated. We will follow this algorithm for dynamically resizing the array of cstrings. Our array will start out with 2 spots and will double in size anytime we need more memory. (If we determine that there are 5 substrings, your return array will need 8 spots.) The algorithm for strtok) is fairly simple. We will look at the cstring, that was passed, a character at a time. For each occurrence of the delimit character we will replace it with a 1O and set a new pointer to the next spot in the cstring. It will continue to do this until the 10' is reached in the original cstring You will need to write and test your solution to get full credit. Here is your prototype. char ** stuStrTok( char*, char
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
