answersLogoWhite

0

Unlike pointer variables and other variables, references have no storage of their own. A reference is simply an alias for an object that already exists in memory (allowing you to refer to the object by its memory address). Since they have no storage of their own it is impossible to create an array of references. You can of course create an array of objects, each of which can then be referenced. You can also have several references to the same object. But you cannot store those references because there is nothing to physically store other than the object itself, which is already stored. For the same reason you cannot reference references nor can you point to references. You can only refer and point to objects (or point to NULL of course).

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Is array list value type or reference type?

Arrays are reference type. array values are always pass by reference.


What level of raw data CANNOT be re-organized to form an array?

There is no level of data that cannot be organised to form an array. Although it is not possible to form an array of references, a reference has no address of its own and cannot be regarded as data. It is a programming tool, nothing more.


Which element of array does this expression refer num5?

which element of the array does this expression reference num[5]


How do you reference the elements in an array?

To reference elements in an array, you typically use the array name followed by an index in square brackets. The index usually starts at 0 for the first element, so for an array named arr, the first element would be accessed with arr[0]. For example, arr[1] would reference the second element. Ensure that the index is within the bounds of the array to avoid errors.


Array is value type or reference type in CSharp?

Array is a class name, hence ought to be a value type.


Is it possible to pass a portion of an array to a function?

Yes. Since passing arrays is a special use of call by reference, simply pass the address of the sub array instead of the primary array. int a[10] = { ... }; myfunction (a); // pass the first element's address myfunction (&(a[3]); // pass the fourth element's address


What are the different between array and variables?

A variable is a reference to a single object (often a number, character, or string of characters). An array is a reference to a contiguous block of memory in which zero or more individual objects.


Is array is value type or reference type in CSharp?

refernce type


How can I double the size of an array efficiently?

To double the size of an array efficiently, you can create a new array with double the capacity, copy the elements from the original array to the new array, and then update the reference to the original array to point to the new array. This process ensures that the array is resized without having to individually resize each element.


Array is value type or reference type in c?

An array always stores the values in its different shells. Whenever the shell position or number or address is mentioned it means the address of the required value is mentioned. then the value of the mentioned address is fetched. So, array is a reference type in c language.


What are the parts of an array?

Its type, name and number of elements. char example[12]; // a char array, named 'example' with 12 elements. The name is also a reference to the array itself, referring to the first element in the array (e.g., example == &example[0]).


How an array passed to a function?

Arrays should be passed by reference or by pointer, never by value (passing by value passes a copy of the reference, not the reference itself). The array length should also be passed to the function (by constant value) to prevent buffer overflows. Alternatively, in object-oriented languages, arrays can be wrapped in a class of object. Since the array is a member of the class, it doesn't need to be passed to the member methods, thus the function can become a member method of the class itself or a derivative of the class. Or the object containing the array can be passed to external functions by reference.