Question: Write a function, substr_count, that counts the occurrences of the subString cpre288 in an input string, srcString. #include #include //YOU CAN USESTRING LIBRARY Functions here//Count

 Write a function, substr_count, that counts the occurrences of the subString

Write a function, substr_count, that counts the occurrences of the subString "cpre288" in an input string, srcString. #include #include//YOU CAN USESTRING LIBRARY Functions here//Count the number of occurrences of "cpre288" in srcString int substr_count(char * srcString, char * subString) {//YOURCODE HERE int main(void) {char srcString[200] = "";//empty string char subString[8]] = "cpre288";//subString int get_count = 0; scanf("%s", srcString);//get a string from input keyboard get_count = substr count(srcString, substring); printf("%s occurs %d times in %s ", substring, get_count, srcString);}

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!