问题描述
您好,
在C中使用非报价终止字符串是否合法?
例如:
printf(Hello World
\ n);
而不是我通常使用的
printf(Hello World
" \ n");
我不相信,但有些编译器似乎允许这样做。只是想
确定我的编译器是否存在问题,或者确实是否允许使用
。 < OT>有没有人知道允许这个的编译器? < / ot>
谢谢
杰森。
Hello,
Is it legal to have a non-quote terminated string in C?
For example:
printf("Hello World
\n");
instead of what I normally use
printf("Hello World"
"\n");
I had believed not, but some compilers seem to allow this. Just want to
be sure if this is a problem with my Compiler, or if it really is
allowed. <ot> does anyone know of compilers that allow this? </ot>
Thanks
Jason.
推荐答案
如果没有
将字符串更改为多个字符串以进行连接,那么字符串不能在行尾打破,但是要剪断
所有上下文仅适用于使用谷歌团体等玩家阅读
新闻组的人。
You are right that strings cannot be broken across end-of-lines without
changing them to multiple strings to be concatenated, but snipping away
all context only works for people using toys like google groups to read
newsgroups.
这篇关于C源代码中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!