◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back► ─────Run-Time Library─────────────────────────────────────────────────────── The scanf function reads the standard input stream stdin, uses the format string to interpret the input as data values, and assigns those values to the locations specified by the arguments. The format string can contain format specifications and additional ordinary characters. Each specification matches an input field in the input stream and corresponds to an argument. See: ◄Format Specifiers► ◄Non-Format Characters► ◄Input Fields► The format string is read from left to right. When a format specification is encountered, the input field is interpreted according to that specification, and the resulting value is assigned to the location specified by the corresponding argument. If there are more arguments than specifications, the extra arguments are evaluated but ignored. If there are fewer arguments than specifications, the results are undefined. Return Value The scanf function returns the number of fields converted and assigned, which may be less than the number of specifications. The return value does not include fields that were read but not assigned. The return value is EOF if the end of file or end of string is encountered in the first attempt to read a character. -♦-