Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribeduse 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions