Menu

[Solved]-Question 11 10 Marks Write Function Char Delete Subst Ring Char Source Char Substring That Q37189388

Question 11 [10 Marks] Write a function char +deleteSubstring (char source, char substring) that takes two strings called souQuestion 11 [10 Marks] Write afunction char *delete SubSt ring (char *source, char *substring)thattakes two strings called source and substring as itsparameters. It should return a new dynamically allocated stringthat is constructed from the strings source and substring. Thenewly created and returned string should be the same as the sourcestring, but with the first occurrence of the string substringremoved. For example, if the string source has the value “mytoronto”, and the string substring has the value “to”, the functionwill return the string “my ronto”. You may use any of thestring-related functions in the C standard library, and may assumethat string. h has been included. Answer. (You can continue yoursolution on the next page.) char *deleteSubString(char *source,char *substring)

Question 11 [10 Marks] Write a function char +deleteSubstring (char source, char substring) that takes two strings called source and substring as its parameters. It should return a new dynamically allocated string that is constructed from the strings source and substring. The newly created and returned string should be the same as the source string, but with the first occurrence of the string substring removed. For example, if the string source has the value “my toronto”, and the string substring has the value “to”, the function will return the string “my ronto”. You may use any of the string-related functions in the C standard library, and may assume that string.h has been included. Answer: (You can continue your solution on the next page.) char deleteSubString (char source, char .substring) ( Show transcribed image text Question 11 [10 Marks] Write a function char +deleteSubstring (char source, char substring) that takes two strings called source and substring as its parameters. It should return a new dynamically allocated string that is constructed from the strings source and substring. The newly created and returned string should be the same as the source string, but with the first occurrence of the string substring removed. For example, if the string source has the value “my toronto”, and the string substring has the value “to”, the function will return the string “my ronto”. You may use any of the string-related functions in the C standard library, and may assume that string.h has been included. Answer: (You can continue your solution on the next page.) char deleteSubString (char source, char .substring) (

Expert Answer


Answer to Question 11 [10 Marks] Write a function char *delete SubSt ring (char *source, char *substring) thattakes two strings ca… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *