Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using eclipse for c language Exercise This lab is designed to give you practice working with pointers and loops. Getting Started To start this exercise,

image text in transcribed
image text in transcribed
using eclipse for c language
Exercise This lab is designed to give you practice working with pointers and loops. Getting Started To start this exercise, you should 1. Open eclipse and create a new project named Lab05 2. Add a Source File (named lab05.c) to this project. 3. Cut the program from this document and paste (replacing everything) in the Eclipes editor window. 4. To restore the original indentation (format) of each program: hold down the ctrl key and type A and then I Lab05.c #include #include // returns true (-1) if str "starts-with" prefix 1/ otherwise returns false (0) int starts with(const char str [] , const char prefix()); int main() char str [256]; printf("Enter a string: "); fflush(stdout); scanf("%s", str); char prefix [256]; printf("Enter a string to search for (\"quit\" to quit) : "); fflush(stdout); scanf("%s", prefix); if ( strcmp(prefix, "quit")) int ans - starts with(str, prefix); if ( ans ) printf("%s is a prefix of %s ", prefix, str); else printf("%s is not a prefix of %s ", prefix, str); } while (strcmp(prefix, "quit")); printf("Done! "); return 0; Problem Description 1. Read through the given code (Lab05.c). 2. The main program uses a "helper" function starts with() to determine and report if the first string that the user enters "starts with the second string. 3. Your task is to write the function definition for the starts with() function (notice that the prototype is given) 4. Once you have written your functions definition: (a) Make sure that your program compiles and runs without errors or warnings. (b) Run your program enough times to check all the cases for correctness. (c) If it runs correctly, then see your TA for a check-off

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions