Driver Code and Test Files
program4.c
names.txt
Grading Rubric
TOTAL: ?? points
Test 1: Filter Initial Letter from Input File (?? points)
Test 2: Verify the Output File (?? points)
Guidelines
In this program, you will learn to:
- Read from a file
- Write to a file
In this lab, you only need to implement a function filter_initial to complete the following features:
- Takes infile (input file name), outfile (output file name), and letter (the target initial letter to search for)
- Opens the input file and reads the names in the file
- Finds and counts the names with the initial matches letter
- Copies and writes the matched names to the output file (one name per line). Overwrite the output file if exists.
- Handles an exception case when outfile is a NULL pointer. In this case, print the matched names to terminal (stdout) instead.
- Returns the count number of matched names

![[Solved] CS580U Program 4 File I/O](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] Program 3 Unix Tools CS580U](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.