The following code snippet should show the integer value of the single character stored in the file. when I put a letter like 'a' for example it works. but when I put this symbol: þ. and several others it shows -2 on the screen. and this symbol according to the ASCII table has value 231. The code is this:
#include <stdio.h>
int main() {
FILE *ptr;
char c;
ptr = fopen("teste.txt", "r");
fscanf(ptr, "%c", &c);
printf("%d", c);
return 0;
}
The only thing stored in test.txt is the symbol þ.