C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
scanf Non-Format Characters
                                             Up Contents Index Back
─────Run-Time Library───────────────────────────────────────────────────────
 
     The characters outside of format specifications are expected to
     match the sequence of characters in stdin outside of the input
     fields; the matched characters are scanned but not stored. These
     characters fall into the following two categories:
 
        ■ White-space characters: blank (" "), tab (\t), or
          newline (\n). A white-space character causes scanf to read,
          but not store, all consecutive white-space characters in the
          input up to the next non-white-space character. One
          white-space character in the format matches any number
          (including zero) and any combination of white-space
          characters in the input.
 
        ■ Non-white-space characters, except for the percent sign (%).
          A non-white-space character causes scanf to read, but not
          store, a matching non-white-space character. If the next
          character in stdin does not match, scanf terminates. The
          conflicting character is left in stdin as if it had not been
          read.
                                    -♦-