Question: Computing 1 C programming C source file, Assgn6.c, on Blackboard: http: //uml.umassonline.net Description: Create a project called Assgn6. Add a C source file to the

Computing 1
C programming  Computing 1 C programming C source file, Assgn6.c, on Blackboard: http:

C source file, Assgn6.c, on Blackboard: http: //uml.umassonline.net Description: Create a project called Assgn6. Add a C source file to the project named assign6.c. A string is nothing but a list of characters. The first character of a string can be pointed by a pointer, say sp, and the 2^nd character of the string can be accessed by *(sp + 1), for example. Also, it may be useful to use a function that returns the number of characters in a string: int strlen (char *string); Write a function int find string char *source, char substring) that searches for the first occurrence of substring in source and returns the index of the first character of substring where it is found in the source. If substring does not occur in source, a value of -1 is returned. For example, if original = "software catalog" and portion = "cat", find string(original, portion) will return 9, since the c of "cat" occurs starting at 9^th position of "software catalog" when the first character s is counted at the 0^th position. The main() function asks for the source string and the substring to search for in the source string, calls the find string() function, and prints the index value returned from the find string() function

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!