- 关 键 词:
- aix
引用:http://www.qqread.com/cpp/e228004.html
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.)进入讨论组讨论。
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++处理for循环作用域规则 (0次浏览)
- 在Ubuntu 7.10中用终端编译运行C++程序 (0次浏览)
- C与C++在Linux下的集成问题 (0次浏览)
- 浅析C++中虚函数的调用及对象内部布局 (0次浏览)
- 在C++中实现四种进程或线程同步互斥的控制 (0次浏览)
- Ubuntu下面的C语言代码检查工具 Splint (0次浏览)



