手机分类
  导航: 电脑时代在线 · 程序设计 · C语言 · C语言编程技巧
有问题吗?看 疑难解答 电脑术语

References and arrays

 
硬件盘点
手机推荐
 
『References and arrays』如果文章有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2005-8-4 
PROBLEM: ajackson@keck.tamu.edu (Andrew J. Jackson)

I'm inquiring on how to declare a reference to an array of integers


RESPONS: Efim Birger (efim@microware.com)

try this:

typedef int *intp;
int arr[10];
intp& aaa = arr;


RESPONSE: fjh@munta.cs.mu.OZ.AU (Fergus Henderson), 11 Aug 94

This code is illegal. `aaa' is a (non-const) reference to a pointer to int.
`arr' is an array of int, which will be converted to a pointer to int.
The result of that conversion is a temporary.
You are initializing a non-const reference with a temporary, which is illegal.


RESPONSE: admin@rzaix13.uni-hamburg.de (Bernd Eggink)

There is no such thing as a reference to an array.


RESPONSE: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)

There most certainly is.
(An array of references is illegal, but a reference to an array is quite OK.)  


如果您有什么疑问,可以至论坛提出或者解答他人的疑问   返回页面顶部

】【关闭窗口
·上一篇教程:
·下一篇教程:
·导航: 电脑时代在线 · 程序设计 · C语言 · C语言编程技巧
相关文章
 
搞笑自拍|图片故事|美女图库|体坛宝贝|明星爆料|世界奇观|风光摄影|历史回忆|大千世界
Photshop超炫图片
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 返回顶部  
网站文本地图
  版权所有:电脑时代在线 2005-2007 欢迎各种媒体转载我们的原创作品[转载请注明出处]
copyright © 2005-2007 www.PCvz.com online services. all rights reserved. 蜀ICP备05015578
Template designed by LaoJiang. Optimized for 1024x768 to Firefox,Opera and MS-IE. Site powered by EQL.
红盾
热爱电脑,热爱生活
拥有电脑,拥有生命
让我们享受拥有电脑的时光