操作员如何使用
可能的重复:
* 和 & 的含义是什么?什么时候应用于变量名?
如何使用 &操作员?这里我有一个例子:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们的意思都是一样的。您使用哪一个编译器并没有什么区别。
对于编译器来说,
所有这三个语句都创建对常量类型的引用。
&
的放置位置只是风格问题。使用您的编码风格/指南建议您使用的风格。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.