-
c++
Why is array of references not allowed??
-
Mr. Brainy
By the way: C++ is not a good title.
A) try an array of pointers instead. A reference is a specific form of a pointer for a sepcific purpose.
B) That specific purpose is so you can pass the ADDRESS of an array to a function. you can't pass the array itself. You increment the pointer by one to get the next element. So really, I can't see a point in having an array of references anyway,
Sean Mackrory
[email protected]
-
Array of referances is allowed.
int& A[4];
-
of Zen Hall
No they're not, even though it would be possible they were disallowed due to the inconsistancies they'd create (sizeof array elements and you can't have a pointer to a reference).
Popular pages
Recent additions