在名称中使用'__' [英] using '__' in names

查看:78
本文介绍了在名称中使用'__'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我经常遇到''_''或''__''用作

函数/宏的前缀/变量名称。我不知道它有一些严格的含义吗?

我在C标准或当地常见问题解答中没有找到任何明确的解释。


最诚挚的问候,罗马Mashak。电子邮件: mr*@tusur.ru

Hello, All!

I often meet that ''_'' or ''__'' is used as prefix to
functions/macros/variables names. I wonder does it have some strict meaning?
I didn''t find any distinct explanation in C standard or local FAQ.

With best regards, Roman Mashak. E-mail: mr*@tusur.ru

推荐答案

Roman Mashak写道:
Roman Mashak wrote:
我经常遇到''_''或''__''被用作
函数/宏/变量名称的前缀。我想知道它有一些严格的含义吗?
I often meet that ''_'' or ''__'' is used as prefix to
functions/macros/variables names. I wonder does it have some strict meaning?




如果我记得:所有符号以下划线开头或包含

两个连续的下划线是保留。这意味着没有便携的

程序可以使用这种标识符。


Daniele



If I remember: all symbols that starts with an underscore or contains
two consecutive underscores are reserved. This means that no portable
programs can uses this sort of identifiers.

Daniele


Roman Mashak写道:
Roman Mashak wrote:
大家好!

我常常遇到''_''或''__''用作
函数/宏的前缀/变量名称。我不知道它有什么严格意义吗?
我在C标准或当地常见问题解答中没有找到任何明确的解释。

最诚挚的问候,Roman Mashak。电子邮件: mr*@tusur.ru
Hello, All!

I often meet that ''_'' or ''__'' is used as prefix to
functions/macros/variables names. I wonder does it have some strict meaning?
I didn''t find any distinct explanation in C standard or local FAQ.

With best regards, Roman Mashak. E-mail: mr*@tusur.ru



一般来说,这样的名字保留用于实施。在你写的代码中不要*使用

这样的名字。[1]


HTH,

--ag


[1]有些情况下它是合法的,但它仍然是一个坏主意。


-

Artie Gold - 德克萨斯州奥斯汀
http://goldsays.blogspot .com (新帖子8/5)
http:// www .cafepress.com / goldsays

如果你没有什么可隐瞒的,你就不会尝试!


In general, such names are reserved for the implementation. Do *not* use
names like this in code you write.[1]

HTH,
--ag

[1] There are situations where it''s legal, but it''s still a Bad Idea.

--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com (new post 8/5)
http://www.cafepress.com/goldsays
"If you have nothing to hide, you''re not trying!"


Daniele Benegiamo写道:
Daniele Benegiamo wrote:
Roman Mashak写道:
Roman Mashak wrote:
我经常遇到''_''或''__''被用作
函数的前缀/ macros / variables名称。我想知道它有一些严格的含义吗?
I often meet that ''_'' or ''__'' is used as prefix to
functions/macros/variables names. I wonder does it have some strict meaning?



如果我记得:所有以下划线开头或包含
两个连续下划线的符号都是保留的。这意味着没有便携式程序可以使用这种标识符。



If I remember: all symbols that starts with an underscore or contains
two consecutive underscores are reserved. This means that no portable
programs can uses this sort of identifiers.




以下划线开头的标识符是保留的,没有这样的

对包含连续下划线的标识符的限制。


Robert Gamble



Identifiers starting with an underscore are reserved, there is no such
restriction on identifiers containing consecutive underscores.

Robert Gamble


这篇关于在名称中使用'__'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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