why we cant create array of refrences

Answers were Sorted based on User's Feedback



why we cant create array of refrences..

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

why we cant create array of refrences..

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

why we cant create array of refrences..

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

why we cant create array of refrences..

Answer / truong

Because address of all the items in an array is continuous. So each item of it cannot reference to a specified variable.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What is rvalue?

0 Answers  


What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class B { float f; char c; int a; }

4 Answers  


Why is c++ difficult?

0 Answers  


Difference between class and structure.

0 Answers  


When can I use a forward declaration?

0 Answers  






3- Write a program to find larger and smaller of the two numbers.

4 Answers   Luminous,


Write about the scope resolution operator?

0 Answers  


What is a class definition?

0 Answers  


Why should we use null or zero in a program?

0 Answers  


What will happen if when say delete this ?

7 Answers  


How many static variables are created if you put one static member into a template class definition?

0 Answers  


Please post the model question paper of hal?

2 Answers  


Categories