My code is reading a file containing integers: 3 2 1 2 2 2 3
FILE *fptr;
fptr = fopen(argv[1], "r");
if (fptr == NULL)
{
printf("Cannot open file \n");
exit(0);
}
int c = fgetc(fptr);
printf("%c", c);
fclose(fptr);
This is outputting the first number 3 as expected but when using it as an integer
printf("%d", c);
it outputs 51 instead? I'm trying to use these numbers as inputs for a counter and positions in a 2D array.
