scanf不工作..... [英] scanf not working.....
本文介绍了scanf不工作.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
char chTitle[MAX_PATH];
//gets(chTitle);
scanf("%[^\t\n]s", &chTitle);
< br $> b $ b
以上代码无法正常工作.... scanf只是跳过....任何线索...我想读取字符串chTitle中的空格
above code not working....scanf is just skipping.... any clue...I want to read string with space in chTitle
推荐答案
scanf
格式说明符不支持正则表达式(或者你写的任何内容),请参阅文档 [ ^ ]。
scanf
format specifiers don''t support regular expressions (or whatever you wrote), see the documentation[^].
参见此处 [ ^ ], scanf()
格式规范不需要正则表达式。
See here[^], scanf()
format specifications do not take regular expressions.
"%[^\t\n]"
怎么样?
这篇关于scanf不工作.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文