Answer the question
In order to leave comments, you need to log in
Doesn't read from a file?
In general, there is a .txt file with the following content:
oleg gil 22 33
zina fuu 23 32
zoya sup 35 21
filya kirya 40 42
pentu pep 25 34
file = fopen("edb.txt", "r");
i = 0;
while (fscanf(file, "%s%s%d%d", &A[i].firstName, &A[i].secondName, &(A[i].age), &(A[i].weight)) != EOF) {
fscanf(file, "%s%s%d%d", &A[i].firstName, &A[i].secondName, &(A[i].age), &(A[i].weight));
printf("%s%s%d%d\n", (A[i].firstName), (A[i].secondName), (A[i].age), (A[i].weight));
N++;
i++;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question