D
D
Dred Wolf2020-12-12 16:50:03
C++ / C#
Dred Wolf, 2020-12-12 16:50:03

What does fscanf return when the value doesn't match the format specifier?

It is necessary to go through the text file through fscanf and check for a reliable record of real numbers. If there is an incorrectly written number (for example, 55-34 or 98zh11), then determine this and perform certain actions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfemidi, 2020-12-12
@DredWulf

Dred Wolf , fscanf returns the number of correctly processed IDs. So if the identifier was "%f", "%e", "%g", "%E", or "%a", then fscanf will return 1 if entered correctly, and any other number (usually 0 or EOF) if not was able to parse the input as a real number.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question