I'm testing some functions for an assignment, but I'm having trouble with these ones:
int countall(*FILE f) {
int value = 0;
char ch;
while((ch = fgetc(arquivo)) != EOF) {
value++;
}
return value;
}
int countchar(FILE *f) {
int count = 0;
char ch;
while ((ch = fgetc(f)) != EOF) {
if (ch >= 'A' && ch <= 'Z')
count++;
}
return count;
}
They do almost the exact same thing, but when I return the functions to int variables and try to print them on the stdout, only the first one called shows the correct value. The second one always shows 0. How do I fix it?