空括号 [英] Empty parentheses

查看:118
本文介绍了空括号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解声明函数定义背后的基本原理,例如


int main(){return 0; } / *空括号* /


已过时,但我无法找出为什么Dennis Ritchie鄙视他们

足以称他们为"。憎恶"评论和/或链接赞赏。


-

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

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

I understand the rationale behind declaring function definitions such as

int main() { return 0; } /* empty parentheses */

obsolete, but I haven''t been able to find out why Dennis Ritchie despised them
enough to call them an "abomination." Comments and/or links appreciated.

--
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" <在*** @ nospam.cyberspace.org>在消息中写道

news:bm ********** @ chessie.cirr.com ...
"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:bm**********@chessie.cirr.com...
我理解声明函数定义的理由as

int main(){return 0; } / *空括号* /

已过时,但我无法找出为什么Dennis Ritchie鄙视他们
足以称他们为憎恶。评论和/或链接赞赏。
I understand the rationale behind declaring function definitions such as

int main() { return 0; } /* empty parentheses */

obsolete, but I haven''t been able to find out why Dennis Ritchie despised them
enough to call them an "abomination." Comments and/or links appreciated.




IIRC,空的parens与以下相同:


int main(.. 。);


表示可变数量的参数。 VARARGS

是皮塔饼,并且有依赖于实现的问题。


如果你真的想要一个空的参数列表,

那么适当的声明是:


int main(无效);


我的大脑对此很模糊,所以如果我做了一个boo-boo

在这里,请更正我。



IIRC, the empty parens is the same as:

int main(...);

which means variable number of arguments. VARARGS
are pita, and have implementation-dependent issues.

If you really want an empty parameter list,
then the proper declaration is:

int main(void);

My brain is fuzzy on this, so if I made a boo-boo
here, please correct me.


" xarax" < xa的*** @ email.com>写在

新闻:Qm *************** @ newsread4.news.pas.earthlin k.net:
"xarax" <xa***@email.com> wrote in
news:Qm***************@newsread4.news.pas.earthlin k.net:
我理解声明函数定义背后的基本原理

int main(){return 0; } / *空括号* /

已过时,但我无法找出为什么Dennis Ritchie鄙视他们足以称他们为憎恶。评论和/或
链接赞赏。
I understand the rationale behind declaring function definitions such
as

int main() { return 0; } /* empty parentheses */

obsolete, but I haven''t been able to find out why Dennis Ritchie
despised them enough to call them an "abomination." Comments and/or
links appreciated.



IIRC,空的parens与以下相同:

int main(...);



IIRC, the empty parens is the same as:

int main(...);




不,它不是。这意味着使用第一次遇到的用法来完成原型的



-

- 马克 - >

-



No, it doesn''t. It means use the first-encountered usage to complete
the prototype.

--
- Mark ->
--


在< bm ********** @ chessie.cirr.com> Christopher Benson-Manica< at *** @ nospam.cyberspace.org>写道:
In <bm**********@chessie.cirr.com> Christopher Benson-Manica <at***@nospam.cyberspace.org> writes:
我理解声明函数定义背后的基本原理,例如

int main(){return 0; } / *空括号* /

已过时,但我无法找出为什么Dennis Ritchie鄙视他们
足以称他们为憎恶。
I understand the rationale behind declaring function definitions such as

int main() { return 0; } /* empty parentheses */

obsolete, but I haven''t been able to find out why Dennis Ritchie despised them
enough to call them an "abomination."




请详细说明。


Dan

-

Dan Pop

DESY Zeuthen,RZ集团

电子邮件: Da ***** @ ifh .de


这篇关于空括号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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