Question: C program pls Write a program that computes statistics on each alphabetic character that appears in a text file. In the program, implement a function

 C program pls Write a program that computes statistics on each

C program pls

Write a program that computes statistics on each alphabetic character that appears in a text file. In the program, implement a function count_chars which accepts a file pointer and an integer array. The function should read the file contents and increase the count in the array corresponding to the character. For example, if the character 'a' is read, then increment the integer at index 0 by 1. The function should compute statistics on lowercase and uppercase letters differently (hint: the array size will be 52). Your function should return an integer indicating the number of characters seen at least once (hint: the maximum will be 52 if all characters were seen). After calling the function, print a report of the statistics calculated. If a character was not seen in the file, your program should not print a line for it (see example output). Example Output $ cat sample.txt TEST sample $ ./a.out sample.txt a: 1 e: 1 1: 1 m: 1 P: 1 S: 1 E: 1 S: 1 T: 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!