Question: c programming 2. Concatenate two files (lastnameCAT.C) Write a C program (call it lastname Cat) that, given two input files (file and file2), it adds
2. Concatenate two files (lastnameCAT.C) Write a C program (call it lastname Cat) that, given two input files (file and file2), it adds their contents and place the results into a new file (file3). The command takes a flag that determines how the files will be added. The command accepts only the following flags: -s': start with file1 o'e': end with file1 Note: All labs are due before next week's lab starts Lab 04 CIS 370 Due: Week of 2/22/2021 for examples and given the following files: file contains: "This is the content of file 1." file contains: "This is the content of file 2." The following command will create files: $lastnameCAT -s filel file2 file3 file contains: This is the content of file 1. This is the content of file 2. While the following command will create file3: $last nameCAT -e filel file2 file3 file contains: This is the content of file 2. This is the content of file 1. Your command should print proper error messages in case the user does not give the command the right number of arguments or the wrong flag (anything other than '-s'or'e'); SlastnameCAT -e file2 filel Error! Usage: MyCat file1 file2 file3 $lastnameCAT -q file2 filel file Error! Usage: you should use either's' or 'e' then the file names
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
