参考和指针 [英] References and pointers

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

问题描述

嗨 -


引用(&)有什么意义?为什么我们不只是使用

指针(*)?


谢谢。

Hi -

What''s the point of having references (&)? Why don''t we just use
pointers (*)?

Thanks.

推荐答案

Simon Saize说:
Simon Saize said:

嗨 -


有什么参考点( &安培;)?
Hi -

What''s the point of having references (&)?



在C中,它们不存在。我建议你从

交叉插件中删除comp.lang.c。

In C, they don''t exist. I suggest you remove comp.lang.c from the
crosspost.


为什么我们不只是使用指针(*)?
Why don''t we just use pointers (*)?



我们这样做。


-

Richard Heathfield< http:// www .cpax.org.uk>

电子邮件:-http:// www。 + rjh @

谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>

Usenet是一个奇怪的放置" - dmr 1999年7月29日

We do.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999


我认为它们存在于某些版本的C中,例如lcc-win也是

支持运营商重载。


2007年12月31日18:43,Daniel T.写道:
I believe they exist in some versions of C, e.g. lcc-win which also
supports Operator Overloading.

On 31/12/2007 18:43, Daniel T. wrote:

Simon Saize< bl *** @ nospam.invalidwrote:

Simon Saize <bl***@nospam.invalidwrote:


>>什么''是否有引用(&)?为什么我们不只是使用指针(*)?
>>What''s the point of having references (&)? Why don''t we just use
pointers (*)?




语言中添加了引用,以方便运算符重载

in C ++。他们甚至存在于C?



References were added to the language to facilitate operator overloading
in C++. Do they even exist in C?


Simon Saize写道:
Simon Saize wrote:

嗨 -


引用(&)有什么意义?为什么我们不只是使用

指针(*)?
Hi -

What''s the point of having references (&)? Why don''t we just use
pointers (*)?



确实没有必要将它发布到comp.lang.c.在C中我们没有

引用,所以这个问题毫无意义。如果你的目标实际上是b $ b了解使用这些的C ++的基本原理(并且有一个,

虽然这是因为我们在comp中的C ++的其他功能。 lang.c

不太开心),comp.lang.c ++中的人应该能够帮助
。然而,你的交叉意味着你的目标是开始另一场毫无意义的语言战;如果是这样的话,我希望没有人能够接受诱饵。


后续行动仅限于comp.lang.c ++,其中实际上问题是
是有意义的。

There really was no need to post this to comp.lang.c. In C we have no
"references", so the question is pointless. If your aim is to actually
learn about the rationale for C++ using these (and there is one,
although it is because of other features of C++ that we in comp.lang.c
do without quite happily), the folks in comp.lang.c++ should be able to
help. However, your crossposting suggests that your aim is to start
another pointless language war; if so, I hope no one rises to the bait.

Follow-ups restricted to comp.lang.c++, where the question actually
makes sense.


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

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