answersLogoWhite

0

Can array subscript be -1

Updated: 11/4/2022
User Avatar

Wiki User

14y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Can array subscript be -1
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the lowest subscript of an array in c plus plus?

The lowest subscript of an array in C, or C++ is 0.


If structure is arraythen an individual array element can be accessed by writing a variable?

A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.


What would the valid subscript values be in a four element array of doubles?

since the array is four elements and array subscripts start at zero, the valid ones would be 0, 1, 2, 3


Why should indexes be used instead of subscripts to identify array elements?

You cannot uses indices instead of subscripts. The subscript operator [] requires an index in order to determine the subscript. Even if you don't use the subscript operator you still need an index to determine the offset of the subscript. Indeed, the only time you do not need an index is when traversing the array using a roving pointer, which is arguably more efficient than using a subscript to traverse an array since subscripts use multiplication instead of the much simpler increment/decrement operation.


True or false when accessing an element of an array such as numbers are the square braces called a subscript?

False. The square braces are the subscript operator. The subscript is the operand, the zero-based offset index that is passed to the operator.

Related questions

What is the lowest subscript of an array in c plus plus?

The lowest subscript of an array in C, or C++ is 0.


If structure is arraythen an individual array element can be accessed by writing a variable?

A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.A structure is not an array. Individual array elements are accessed through a number, called a "subscript". This subscript can be a constant, or a variable, or any expression that can be evaluated to give an integer.


What is the relationship between the value of the subscript and the value of the array element in c?

You can access the array-element via index (or subscript), but it is not possible the other way around.


What would the valid subscript values be in a four element array of doubles?

since the array is four elements and array subscripts start at zero, the valid ones would be 0, 1, 2, 3


What happens if a subscript value is negative or higher than the number of elements in an array?

It cannot be part of the array.


Every element in an array is assigned an unique number known as?

subscript


Why should indexes be used instead of subscripts to identify array elements?

You cannot uses indices instead of subscripts. The subscript operator [] requires an index in order to determine the subscript. Even if you don't use the subscript operator you still need an index to determine the offset of the subscript. Indeed, the only time you do not need an index is when traversing the array using a roving pointer, which is arguably more efficient than using a subscript to traverse an array since subscripts use multiplication instead of the much simpler increment/decrement operation.


True or false when accessing an element of an array such as numbers are the square braces called a subscript?

False. The square braces are the subscript operator. The subscript is the operand, the zero-based offset index that is passed to the operator.


What is the difference between subscript and subscripted variable in c plus plus?

Subscripts are used to identify the elements in an array, where the first element has subscript 0. Thus an array of n elements has subscripts in the range 0 to n-1. Each element may itself be an array, thus allowing multi-dimensional arrays. The subscript may be a constant or a variable. However, when declaring a static array, the subscript must be a constant. Constants include literal constants as well as named constants. A subscripted variable is simply an array or a datatype that can be divided into an array. For instance, a 32-bit int can be treated just as if it were an array of two 16-bit shorts or four 1-byte chars. Thus in the 32-bit int array, int i[10], i is a subscripted variable where i[0] is the first integer and i[9] is the last. If we then say char*c=&i, c would allow us to treat i as if it were a subscripted variable with 40 char elements (c[0] to c[39]).


Dope vector method for one dimentional array?

Dope Vector Method is use for one dimensional array and also two-dimensional array for one dimensional array we use MA(i)=sa+(i-1)*w MA is Memory Address Sa = Start Address i is subscript W for integer w=2 float=4 char=1 for two dimensional array MA(i,j)=SA{n(i-1)+(j-1)}*W


What is array What is difference between array and simple variable?

An array stores several values - for example, several numbers - using a single variable name. The programmer can access the individual values with a subscript, for example, myArray[0], myArray[5]. The subscript can also be a variable, for example, myArray[i], making it easy to write a loop that processes all the elements of an array, or some of them, one after another.


What is array variable?

An array is a variable containing multiple values. Any variable may be used as an array. There is no maximum limit to the size of an array, nor any requirement that member variables be indexed or assigned contiguously. Arrays are zero-based: the first element is indexed with the number 0.