printf("string1""string2");
令我惊讶的是,它编译并生成了一个串联的字符串输出,即
string1string2
这是有效的C吗?
我使用的是gcc版本4.4.1(Ubuntu 4.4.1-4ubuntu9)
解决方法 是的.连续字符串文字在解析C的早期连接.6.4.5 / 4:
总结In translation phase 6,the multibyte character sequences specifIEd by any sequence of adjacent character and wIDe string literal tokens are concatenated into a single multibyte character sequence. If any of the tokens are wIDe string literal tokens,the resulting multibyte character sequence is treated as a wIDe string literal; otherwise,it is treated as a character string literal.
以上是内存溢出为你收集整理的printf(“string1”“string2”)是这个有效的C?全部内容,希望文章能够帮你解决printf(“string1”“string2”)是这个有效的C?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)