论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > C语言程序设计教程
Tag:新手,函数,指针,数据类型,对象,Turbo,入门,运算符,数组,结构,二级,,tc,游戏,试题,问答,编译,视频教程

References and arrays

文章类别:C语言程序设计 | 发表日期:2008-9-24 14:36:49

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语言程序设计热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058