Why isn't this working?
All I want to do is take a character from one text file and copy it in a new text file...
Code:
int main(){
#include <stdio.h>
FILE *tf = fopen("./map", "r");
FILE *af = fopen("./array", "w");
unsigned char x;
while ( ( x = fgetc( tf ) ) != EOF )
{
fprintf( af, "%c", x);
}
return 0;
}
But I get the following warning on the while loop, and of course, an endless loop:
reader.c: In function `main':
reader.c:9: warning: comparison is always true due to limited range of data type