Hi , Can you have a look at my code it should display integer in file but it doesn't
#include <stdio.h>
/* This function reads two values from a file. */
int demonstrate_fscanf(void)
{
FILE *InFile;
int b, numValuesRead;
InFile = fopen("fadata.rtf", "r");
if (InFile == NULL) {
printf("File not found.\n");
return -1;
}
/* Read two numbers from the file */
numValuesRead = fscanf(InFile, "%d", &b);
printf("%d.\n", b);
return 0;
}
int main(void)
{
demonstrate_fscanf();
return 0;
}
File content
3 4 6 7 8 9