#include<stdio.h>
#include<string.h>
void main ()
{
char matn[1024];
char str[80];
int i=23456;
double A[200];
FILE *f;
f = fopen ("test.txt", "r");
if (!f) { // f==NULL
printf("Cannot open test.txt for writing.\n");
return;
}
fseek(f, 3, 0);
while (!feof(f)) {
//fscanf(f, "%s", str);
char *readOK = fgets(str, 79, f);
if (readOK == NULL)
break;
if (str [ strlen(str)-1 ] == '\n')
str [ strlen(str)-1 ] = 0;
printf("%s\n", str);
long moghe_eeyyat_dar_file = ftell(f);
printf ("ftell=%ld\n", moghe_eeyyat_dar_file);
}
//while (!feof(f)) {
// fscanf(f, "%d", &i);
// printf("%d\n", i);
//}
fclose(f);
}