Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C program, use only #include and no alternate libraries.... (20 points) Write a program that contains a function called findString() that determines if one

in C program, use only #include and no alternate libraries....

image text in transcribed

(20 points) Write a program that contains a function called findString() that determines if one character string exists inside another string. The first argument to the function should be the character string that is to be searched and the second argument is the string you are interested in finding. If the function finds the specified string, have it return the location in the source string where the string was found. If the function does not find the string, have it return -1. So, for example, the call index - findString ("a chatterbox", "hat"); searches the string "a chatterbox" for the string "hat". Because "hat" does exist inside the source string, the function returns 3 to indicate the starting position inside the source string where "hat" was found The program should prompt the user for two strings, one that is to be searched, and another is a string to be found. The program should then print out the location in the string to be searched where the second string is found. If no string is found, an appropriate message should be displayed. Use the readLine function presented in class to get strings from the user

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago