I want this program to scan a text file (given as an argument) and just put the alpha characters it finds. Why isn't it working? Thanks!
Code:#include <stdio.h> #include <ctype.h> int main(int argc, char *argv[]) { int ch; FILE *input = NULL; if(!(input = fopen(argv[1], "r"))) { printf("Error opening file!\n"); return 1; } while(ch = fgetc(input) != EOF) { if(isalpha(ch)) putchar(ch); } return 0; }