一个关于格式串%*[^/n]的有关问题

一个关于格式串%*[^/n]的问题
fscanf(fd, "%*[^\n] ");是什么意思?

------解决方案--------------------
不要告诉我搜不到……


MSDN的文章及详细相关解释:
http://support.microsoft.com/kb/67879/en-us

Format
Specifier Usage
------------------------------

%[a-z] Read the input string until the library encounters a
character other than a lowercase letter ( "abc...z ").

%[^a-z] Read the input string until the library encounters a
lowercase letter.

%[]] According to the ANSI specification, read a series of
right bracket (]) characters from the input string.

%[^]] Read the input string until the library encounters a
right bracket character.

%*[^%] Scan the input string (without storing it in a
variable) until the library encounters a percent sign
(%) character. (The asterisk "* " instructs the compiler
to scan the string without storing it in a variable.)

%[-af-k] Read the input string until the library encounters a
character other than a hyphen (-), a lowercase "a ", or
a character between the lowercase "f " and lowercase "k "
characters (fghijk).

%[] Illegal -- unpredictable results. The compiler does not
detect this error because it is in a parameter string.

%[^] Illegal -- unpredictable results. The compiler does not
detect this error because it is in a parameter string.

%40c Read 40 characters from the input string. [The run-time
library does not automatically append a null terminator
to the string, nor does reading 40 characters
automatically terminate the scanf() function. Because the
library uses buffered input, you must press the ENTER key
to terminate the string scan. If you press the ENTER before
the scanf() reads 40 characters, it is displayed normally,
and the library continues to prompt for additional input
until it reads 40 characters.] '

%[^.-] Read the input string until the library encounters a
period (.) or a hyphen (-).


K&R上的相关解释:

A conversion specification determines the conversion of the next input field. Normally the result is placed in the variable pointed to by the corresponding argument. If assignment suppression is indicated by *, as in %*s, however, the input field is simply skipped; no assignment is made. An input field is defined as a string of non-white space characters; it extends either to the next white space character or until the field width, if specified, is exhausted. This implies that scanf will read across line boundaries to find its input, since newlines are white space. (White space characters are blank, tab, newline, carriage return, vertical tab, and formfeed.)

...

[...] matches the longest non-empty string of input characters from the set between brackets; char *. A '\0 ' is added. []...] includes ] in the set.
[^...] matches the longest non-empty string of input characters not from the set between brackets; char *. A '\0 ' is added. [^]...] includes ] in the set.


Google 搜 "scanf 高级 "两个关键字得到的相关文章
http://blog.csdn.net/yaloe/archive/2007/03/25/1540929.aspx