请看一下这个代码片段:
char line[80];
if(fscanf(stdin, "%*[\t\v\f ]%79[^\n]", line) != EOF)
printf("%s\n", line);
输出:
$ gcc line.c -o line
$ ./line
One space at the beginning.
One space at the beginning.
$ ./line
No space at the beginning.
$
现在如果No space at the beginning
整个字符串没有按原样打印?
$ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3