Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started