why we cant create array of refrences
Answers were Sorted based on User's Feedback
Answer / o saienni
You cannot have a pointer to a reference.
In other words
int &* isn't allowed.
using:
int nArray[3];
The variable nArray is infact a pointer to an array or an
int pointer and the [] will find the offset within that
array. So an array of references will be a pointer to a
reference and this is why it's not allowed.
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / som shekhar
Since References are not objects and they dont have any
storage of their own , they always refer to the existing
object. Therefore it doesn't make sense to have an array of
reference.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / narender vadhava
in array like a[50];
[] = subscript caller
this subscript caller is use to increment the pointer of
variable or say offset of the variable not to increase the
value so we cant crate array of refrences.
| Is This Answer Correct ? | 1 Yes | 1 No |
What is a memory leak c++?
What are the static members and static member functions?
What is the use of data hiding?
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
If there are 1 to 100 Numbers in array of 101 elements. Which is the easy way to find repeated number?
Can union be self referenced?
What does override mean in c++?
Difference between overloading vs. Overriding
What does #define mean in c++?
if int1 has the value 12, int has the value 18, and int3 has the value 21, what is the result: int1 < int2 && int2 < int 3
When to use “const” reference arguments in a function?
Do we have to use initialization list in spite of the assignment in constructors?