(Section 1)
I have a text file with one line of numbers: 6123456123456123
(Section 2)
Here is my code to read and print the file:
FILE *fp = fopen("myFile.txt", "r");
int firstInt;
int counter = 6
firstInt = fgetc(fp);
printf("First character of this text file is: %i", firstInt)
if (firstInt == counter)
printf("firstInt equal counter"); // <<< This part is important for me, I want to be able to compared firstInt to counter and if similar print this line.
(Section 3)
Output: First character of this text file is: 54
(Section 4)
My question: why is the return int 54 instead of 6? Obviously it will not print the second line for the reason stated before.