char数组初始化:'char a [] =(" a")'有效ANSI C? [英] char array initialization: Is 'char a[] = ("a")' valid ANSI C?

查看:105
本文介绍了char数组初始化:'char a [] =(" a")'有效ANSI C?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



代码片段''char a [] =(" a");''有效的ANSI C?

有问题的部分是''(a)''。我确定''char a [] =" a" ;;''有效

ANSI C,但我更不确定是否允许放置()围绕

字符串文字。


Is the code fragment ''char a[] = ("a");'' valid ANSI C? The
problematic part is ''("a")''. I am sure ''char a[] = "a";'' is valid
ANSI C, but I am more unsure if it is allowed to place () around the
string literal.

推荐答案

2004年11月1日星期一17:13:10 +0100

Petter Reinholdtsen < PE ** @ hungry.com>写道:
On Mon, 01 Nov 2004 17:13:10 +0100
Petter Reinholdtsen <pe**@hungry.com> wrote:
代码片段''char a [] =(" a");''有效ANSI C?
有问题的部分是''(a)''。我肯定''char a [] =" a" ;;''有效
ANSI C,但我更不确定是否允许在
字符串文字周围放置()。
Is the code fragment ''char a[] = ("a");'' valid ANSI C? The
problematic part is ''("a")''. I am sure ''char a[] = "a";'' is valid
ANSI C, but I am more unsure if it is allowed to place () around the
string literal.




是的。我无法想象在表达式周围放置

括号是非法的。

-

Flash Gordon

有时候我觉得拍摄对某些人来说太好了。

虽然我的电子邮件地址说垃圾邮件,但它是真实的,我读了它。



Yes it is. I can''t think of any situation where it is illegal to put
brackets around an expression.
--
Flash Gordon
Sometimes I think shooting would be far too good for some people.
Although my email address says spam, it is real and I read it.


Flash Gordon< sp ** @ flash-gordon.me.uk>这样说:
Flash Gordon <sp**@flash-gordon.me.uk> spoke thus:
是的。我不能想到在表达式周围放置
括号是非法的。
Yes it is. I can''t think of any situation where it is illegal to put
brackets around an expression.




您的意思是说括号吗? "托架"是''[''和'']'',

至少用我熟悉的说法。


第二个想法,字典.com说括号可以表示

括号用英式英语是一个或另一个标准,或

我们是否像其他许多地方一样受到方言的支配?


-

Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我

ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。



Did you mean to say "parentheses"? "Brackets" are ''['' and '']'', at
least in the parlance I''m familiar with.

On second thought, dictionary.com says "bracket" can mean
"parenthesis" in British English. Is one or the other standard, or
are we at the mercy of dialect here as in many other areas?

--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.


Christopher Benson-Manica< at *** @ nospam.cyberspace.org>写道:
Christopher Benson-Manica <at***@nospam.cyberspace.org> writes:
Flash Gordon< sp ** @ flash-gordon.me.uk>这样说:
Flash Gordon <sp**@flash-gordon.me.uk> spoke thus:
是的。我不能想到在表达式周围加上
括号是非法的。
Yes it is. I can''t think of any situation where it is illegal to put
brackets around an expression.



你的意思是说括号吗? "托架"是''[''和'']'',至少在我熟悉的说法中。

在第二个想法中,dictionary.com说括号。可以指
括号用英式英语是一个或另一个标准,或者
我们是否像其他许多方面一样受到方言的支配?



Did you mean to say "parentheses"? "Brackets" are ''['' and '']'', at
least in the parlance I''m familiar with.

On second thought, dictionary.com says "bracket" can mean
"parenthesis" in British English. Is one or the other standard, or
are we at the mercy of dialect here as in many other areas?




在我个人的英语方言中,术语是(括号),

[方括号]和{大括号}。其他方言可能有所不同。我认为

术语括号是明确的,但如果有任何疑问,那么最好使用[方括号]和{花括号}来引用b $ b。更好的是,使用

字符本身。


-

Keith Thompson(The_Other_Keith) ks *** @ mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< * GT; < http://users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。



In my personal dialect of English, the terms are (parentheses),
[brackets], and {braces}. Other dialects may differ. I think the
term "parentheses" is unambiguous, but if there''s any doubt it''s best
to refer to [square brackets] and {curly braces}. Better yet, use the
characters themselves.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


这篇关于char数组初始化:'char a [] =(&quot; a&quot;)'有效ANSI C?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆