Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a program that copies the data from one file to another while converting all characters matching the search key with that of the

image text in transcribed

1. Create a program that copies the data from one file to another while converting all characters matching the search key with that of the replace key. Your program should accept four arguments: (a) input filename (b) output filename (c) search character (d) replace character Warn the user if the input file does not exist. Your program should check to make sure the output file does not already exist. If it does, print "DESTINATION FILE EXISTS." to stdout. Print the number of characters changed to stdout using the format string "%d characters changed." The search and replace characters are case-sensitive. Save your code as search_and_replace.c. Example Run $ ./a.out input.txt output.txt A d 15 characters changed

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

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago

Question

=+ For what reasons can and do unions go on strike?

Answered: 1 week ago

Question

=+ Is secondary industrial action common and/or legal?

Answered: 1 week ago