Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Download the file patternMatch.c from Canvas. This file contains part of a program to do pattern matching. The function main looks like this: The function

Download the file patternMatch.c from Canvas. This file contains part of a program to do pattern matching. The function main looks like this:

image text in transcribed

The function readline should read a line of characters from the keyboard. The second argument to the function is the maximum number of characters to read. If a line has more characters than that, the function should ignore the rest of the characters on the line. The function returns the number of characters read. Note that the array should not contain the ' ' from the end of the line, nor should it include a terminator character such as '

adminuser@adminuser-VirtualBox~/Desktop $./a.out Enter text: abcdefg Enter pattern: ?bc? The pattern was found at char 1. The remaining text chars are: efg adminuser@adminuser-VirtualBox -/Desktop $/a.out Enter text: abcdefg Enter pattern: b?c no match adminuser@adminuser-VirtualBox /Desktop $-a Enter text: abcdefg Enter pattern: b??e?g The pattern was found at char 2. The remaining text chars are: adminuser@adminuser-VirtualBox -/Desktop $ adminuser@adminuser-VirtualBox~/Desktop $./a.out Enter text: abcdefg Enter pattern: ?bc? The pattern was found at char 1. The remaining text chars are: efg adminuser@adminuser-VirtualBox -/Desktop $/a.out Enter text: abcdefg Enter pattern: b?c no match adminuser@adminuser-VirtualBox /Desktop $-a Enter text: abcdefg Enter pattern: b??e?g The pattern was found at char 2. The remaining text chars are: adminuser@adminuser-VirtualBox -/Desktop $

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_2

Step: 3

blur-text-image_3

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

Describe how to train managers to coach employees. page 404

Answered: 1 week ago

Question

Discuss the steps in the development planning process. page 381

Answered: 1 week ago