Question: Write a function that takes a string and splits it up to an array of strings. The split will be length-based: the function will also

Write a function that takes a string and splits it up to an array of strings. The split will be length-based: the function will also take an integer n and will split the given string up into strings of length n. It is possible that the last string will not be of length n. You will not need to communicate how large the resulting array is as the calling function knows the string length and n. char **lengthSplit(const char *s, int n); For example, if we pass "Hello World, how are you?" with n = 3 then it should return an array of size 9 containing the strings "Hel" , "lo " , "Wor" , "ld," , " ho" , "w a" , "re " , "you" , "?"

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!