- 论坛徽章:
- 0
|
A nonwhitespace character in the format string causes scanf( ) to read and discard a matching character. For example, %d,%d causes scanf( ) to first read an integer, then read and discard a comma, and finally read another integer. If the specified character is not found, scanf( ) will terminate.
A whitespace character in the format string causes scanf( ) to skip over zero or more whitespace characters in the input stream. A whitespace character is either a space, a tab character, or a newline. In essence, one whitespace character in the control string will cause scanf( ) to read, but not store, any number (including zero) of whitespace characters up to the first nonwhitespace character.
遇到非空字符scanf()读取并存储。空字符scanf()只读而不存储。
好好理解这段英语。
[ 本帖最后由 chinesedragon 于 2007-8-18 17:44 编辑 ] |
|