操作员如何使用

发布于 2024-12-15 07:06:18 字数 351 浏览 0 评论 0原文

可能的重复:
* 和 & 的含义是什么?什么时候应用于变量名?

如何使用 &操作员?这里我有一个例子:

Const  type& var
Const type & var
Const type &var

这是什么意思? 最好的

Possible Duplicate:
What's the meaning of * and & when applied to variable names?

How to use & operator? herein i have an example:

Const  type& var
Const type & var
Const type &var

what does it mean?
Bests

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝咒 2024-12-22 07:06:18

它们的意思都是一样的。您使用哪一个编译器并没有什么区别。
对于编译器来说,
所有这三个语句都创建对常量类型的引用。

& 的放置位置只是风格问题。使用您的编码风格/指南建议您使用的风格。

All of them mean the same. It makes no difference to the compiler which one you use.
For the compiler,
All three of those statements create a reference to a constant type.

It is a mere matter of style where to place the &. Use the style which your coding style/guidelines suggest you to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文