forked from 131/lab0.1_letscontinue
12
This commit is contained in:
5
wcl.c
5
wcl.c
@@ -3,10 +3,6 @@
|
||||
#include <ctype.h>
|
||||
void process_file(const char *filename, long *lines, long *words, long *bytes) {
|
||||
FILE *file = fopen(filename, "r");
|
||||
if (!file) {
|
||||
perror(filename);
|
||||
return;
|
||||
}
|
||||
int ch;
|
||||
int in_word = 0;
|
||||
while ((ch = fgetc(file)) != EOF) {
|
||||
@@ -23,7 +19,6 @@ void process_file(const char *filename, long *lines, long *words, long *bytes) {
|
||||
fclose(file);
|
||||
}
|
||||
int main(int argc, char *argv[]) {
|
||||
long total_lines = 0, total_words = 0, total_bytes = 0;
|
||||
printf("Name\tLines\tBytes\tWords\n");
|
||||
for (int i = 1; i < argc; i++) {
|
||||
long lines = 0, words = 0, bytes = 0;
|
||||
|
||||
Reference in New Issue
Block a user