- Name This Program Filter C The Program Takes Two Command Line Arguments The Name Of An Input File And The Name Of An 1 (54.14 KiB) Viewed 10 times
Name this program filter.c. • The program takes two command line arguments: the name of an input file and the name of an
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Name this program filter.c. • The program takes two command line arguments: the name of an input file and the name of an
Name this program filter.c. • The program takes two command line arguments: the name of an input file and the name of an output file. The program should confirm the input and output files can be opened. If a file cannot be opened, print the error message Cannot open file '<filename>' where <filename> is the name of the file and return. o fopen() will return 0 if it fails to open a file. • Then, the program will read the file string by string (up to 50 characters in length). If the string consists of only uppercase and lowercase characters, print it. • You can use isalpha(char) declared in ctype. h to check whether a character is a-z or A-Z. o continue and break might be useful. • Don't forget to close your files! It will likely fail the test cases if files are not closed. Examples ./a.out example.txt output.txt example.txt The Quick Brown Fox Jumps over the Lazy Old Dog. ALABAMA? Roll Tide!!! P2P 1831 (UA) output.txt The Quick Brown Fox Jumps over the Lazy Old Roll