Immer Puffer leeren nach Eingabe?

1 Antwort

Also Posix sagt:

A directive composed of one or more white-space characters shall be executed by reading input until no more valid input can be read, or up to the first byte which is not a white-space character, which remains unread.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fscanf.html

Das heißt, soweit ich das verstehe, musst du nur ein White-Space an das Ende deines Format-Strings packen und der Stream wird geleert.


Lolol464 
Beitragsersteller
 10.12.2022, 20:17

Was ist ein White space?

1
Destranix  10.12.2022, 20:19
@Lolol464

Steht auch in der verlinkten Doku. Soetwas wie Leerzeichen, Tab, Newline, Carriage-Return, ...

0