Question: #include int del_substr(char* str, char* substr) { //Write your code here, Return 1 for found and removed, return o for not found } int main()

 #include int del_substr(char* str, char* substr) { //Write your code here,
Return 1 for found and removed, return o for not found }

#include int del_substr(char* str, char* substr) { //Write your code here, Return 1 for found and removed, return o for not found } int main() { //Do not change anything in main() char source[] = "ABCDEFGHIJKLMN"; char subsource[] = "DEF"; printf("%s ", source); printf("%s ", subsource); if (del_substr(source, subsource) == 1) { printf("Delete the substr: "); printf("%s ", source); } else printf("Have not found the substr! "); char second_subsource[] = "XYZ"; if (del_substr(source, second_subsource) == 1) { printf("Delete the substr: "); printf("%s ", source); } else printf ("Have not found the substr! "); getchar(); return 0; } /* Your output will ecactly the same as following ABCDEFGHIJKLMN Lab 8 Exercise 1. Download the Lab8.c from BlackBoard->PRG255NAAL->Assignments->Lab8 2. Modify the int del_substr(char* str, char* substr) function, this function will take two string as parameter and check if the first string contains the second string as a sub-string, if the second string is a sub-string of first one return 1 and remove the sub-string from the first string. If it is not a sub- string, return 0 For example: if first string is "ABCD" and second string is "BC" therefore the function will return 1 and changes the first string to "AD" 3. Rename your work as Lab8-Your Name-YouStudentiD.C 4. Summit your code on blackboard Important: NO OTHER HEADER FILE IS ALLOWED

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!