L
L
LoliDeveloper2021-06-20 12:23:49
C++ / C#
LoliDeveloper, 2021-06-20 12:23:49

Fixed length of number read in fscanf()?

This thing reads a number of length no more than 2 And I need it to read only and only numbers, length exactly 2, how to do this? For example, she does not count the number 1, but 01 counts
fscanf(f, "%2u ", &ulong)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LoliDeveloper, 2021-06-20
@LoliDeveloper

Here they said that you can use % n to control the number of characters read, but in general you need to read a string and parse it already.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question