The number of dimensions is immaterial. All arrays are implemented as a one dimensional array. A multidimensional array is simply an array where every element is itself an array.
The only thing actually known about any array is that its name is a reference to the start address. Unlike an ordinary (non-array) variable, the elements in the array do not have names, we can only refer to them by their memory offsets from the start of the array. As such, in order to obtain the values stored at those offsets, we must dereference them. While the subscript operator gives us notational convenience, it's easy to forget that there's actually pointer arithmetic and dereferencing going on behind the scenes.
Array elements can be pointers, and pointers can point to array elements, if that's what you mean.
An array's name implicitly converts to a pointer to the first element of the array at the slightest provocation. Thus to access the first element of the array, the array name suffices. To access any other element in the array without using the suffix operator, use offset pointer arithmetic. For example: int a[] = {2, 4, 6, 8, 10}; int b; b = *(a+3); assert (b == 8); Here, (a+3) points to the 4th element (offset 3). Dereferencing this address returns the value of that element, in this case 8.
To access a hidden global variable, use the scope resolution operator ::
pointer -> fieldname
The answer is Between in an Access question.
Data type is mandatory in every variable-declaration.Example:int i; -- integerint *pi; -- integer-pointerint ai[10]; -- integer-arrayint *api[10]; -- array of integer-pointersint (*api)[10]; -- pointer to integer-array
An array's name implicitly converts to a pointer to the first element of the array at the slightest provocation. Thus to access the first element of the array, the array name suffices. To access any other element in the array without using the suffix operator, use offset pointer arithmetic. For example: int a[] = {2, 4, 6, 8, 10}; int b; b = *(a+3); assert (b == 8); Here, (a+3) points to the 4th element (offset 3). Dereferencing this address returns the value of that element, in this case 8.
When a pointer variable stores a non-zero memory address, we can use the dereference operator to access the value stored at that address. This is what we mean by dereferencing and is also known as indirection because we can access a value indirectly through a pointer variable. Note that if the stored address is zero, we must not dereference the pointer as the zero address indicates that the pointer is not currently pointing at any object in particular. The zero address is a reserved address so no object can ever be allocated to it.
operator
To access a hidden global variable, use the scope resolution operator ::
The dot member access operator (or, in simple terms, the period) specifies the hierarchy of namespaces.
The scope resolution operator, ::, overrides local scope and allows access to objects that are hidden due to global to local scope rules.
pointer -> fieldname
The public access modifier will make an element available to any class.
The answer is Between in an Access question.
(*ptr).field or ptr->field
C uses pointers for indirection. So, using a pointer to a pointer would be multiple indirection. For example, the following code uses multiple indirection:int i = 42;int *pi = &i;int **ppi = π**ppi++;printf("i is now %d\n", i);
Data type is mandatory in every variable-declaration.Example:int i; -- integerint *pi; -- integer-pointerint ai[10]; -- integer-arrayint *api[10]; -- array of integer-pointersint (*api)[10]; -- pointer to integer-array