Hi
Why does this not compile? Cant see the error
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(void)
{
char *c;
FILE *f = fopen("file.txt", "r");
if(f == NULL) {
printf("Could not open file");
}
while((c = fgetc(f)) != EOF) {
if(strcmp(c, " ") == 0) {
printf(" ");
} else if(strcmp(c, ":") == 0) {
printf(":");
} else if(strcmp(c, "@") == 0) {
printf("@");
} else if(strcmp(c, "\n") == 0) {
printf("\n");
} else {
printf("Not a valid char");
}
}
}