读书人

please expain this sentence quot;fscanf

发布时间: 2012-02-29 16:44:11 作者: rapoo

please expain this sentence "fscanf(fd, "%*[^\n]");"
What is the meaning of the *format* informaiton?
3ks

[解决办法]
"%[^\n] "表示读输入字符串,直到碰到字符‘\n’为止,其中^表示否的意思; "%[abc] "表示只读字母为 'a '、 'b '、 'c '的字符串,碰到不是这些字符就结束,如输入字符串为“abbacdab”,那么得到的字符串就是abbac了。
[解决办法]
利用正则表达式匹配。。某些 libc 的扩展。

读书人网 >C语言

热点推荐