Need help with fscanf's blue.
-
I don't know what a teacher wants from me. ♪ ♪ I'm in the cycle scanning the sequence and the type of all the occiphers are still comparable to one, then out of the cycle, so I'm asking you to make sure that I put the league on the screen the values that Fscanf returns... I don't understand how to do it, don't you tell me?
-
There are two options for answering the question (which is correct, it is difficult to understand):
(1) Removal to the printed F-y
fscanf
values:int value, n; fscanf(file_pointer, "%d", &value); printf("%d\n", value);
(2) Extraction of the number of F-sized
fscanf
values (originally reverted)int value, n; n = fscanf(file_pointer, "%d", &value); printf("%d\n", n);
For use above
fsanf
(to remember this function with a variable number of arguments)n
may accept:1
- All RS, counting exactly 1 number;0
- the whole number was not considered; orEOF
- at the end of the file.int n; while ((n = fscanf(...)) == 1) { printf("%d\n", n); ... }