Table of Contents Previous topic Next topic
C COMPILER LIBRARY FUNCTIONS->Detailed Descriptions->scanf()
Summary
#include <stdio.h>
int scanf(const char* format, ...);
Parameters
format | Format control string |
... | Arguments to receive scanned data |
Character | Argument | Input Data |
Type |
d | int * | Decimal integer. |
I | int * | Integer. The integer may be octal (leading 0) or hexadecimal (leading 0x or 0X). |
o | int * | Octal integer (with or without a leading zero). |
x | int * | Hexadecimal integer (with or without a leading 0x or 0X). |
u | unsigned | Unsigned decimal integer. |
int * | ||
c | char * | Character. The next x input characters are placed in the argument array, where x is the value of the field width or 1 if no field width is given. The normal skip white space characters is suppressed. |
s | char * | String. The argument points to an array of characters which should be large enough to hold the string and a terminating '\0' that will be added. |
e,f,g | float * | Floating point value consisting of an optional sign (+ or -), a series of one or more decimal digits containing a decimal point and an optional exponent (e or E) followed by an optional signed integer value. |