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

When the design recommends static functions?

2 Answers   Symphony,


the maximum length of a character constant can be a) 2 b) 1 c) 8

0 Answers  


What is the function to call to turn an ascii string into a long?

0 Answers  


What is the difference between structure and class?

0 Answers  


How to stop conversions among objects?

5 Answers   Symphony,






Explain calling an object's member function(declared virtual)from its constructor?

1 Answers  


why c++ is not called strictly d super set of c?

3 Answers   Satyam,


What is a buffer c++?

0 Answers  


Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

0 Answers  


How do you generate a random number in c++?

0 Answers  


Give 10 points of differences between C & C++.

0 Answers   HCL,


Categories