Hello i got a problem im trying to solve problem and learn how the learning from files works .I did this code by tutorial and when i execute instead of learning my file and write on console something like 1 4 6 5 1 etc.. its just spam only 0 0 0 0 0 0 0 and then repeat If you would say me where is the problem it will be good thanks for ur time :)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define UNUSED(__ARG__) ((void)__ARG__)
int main(int argc, char** argv)
{
UNUSED(argc);
UNUSED(argv);
int i = 0;
FILE* x =fopen("cisla.txt","r");
fscanf(x,"%d",&i);
while (!feof (x))
{
printf("%d",i);
fscanf(x,"%d",&i);
}
fclose(x);
return 0;
}