if ((fi = fopen("file.txt","r")) == NULL )
{
fprintf(stderr,"Can't open file file.txt for reading\n");
exit(1);
}
fscanf(fi, "%d", &array[i]);
while (!feof(fi))
{
i++;
fscanf(fi,"%d",&array[i]);
}
Back to Questions
|
Back to Main Page for Lecture 8 |