answersLogoWhite

0


Best Answer

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]).

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between subscript and subscripted variable in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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.


The difference between fixed and variable inputs?

difference between fixed and variable inputs


Difference between variable resistor and rheostat?

The difference between a variable resistor and a rheostat is the same as the difference between six and half a dozen.


What the difference between a variable and control?

The difference between a controlled variable and a variable is in their state. A controlled variable is something which is rigid and constant while a variable is liable to change and inconsistent.


WAP to show the difference between a variable and static variable?

difference between constant and static variables in java


What is the difference between a variable being tested and a variable being controlled?

The difference between these both is that the control is what stays the same in an experiment and the variable is what changes.


What is one difference between a variable and a numerical expression?

The variable.


What is the difference between fix and variable mortgages?

The difference between fixed and variable mortgages are that in a fixed mortgage, the rate can not change. In a variable mortgage, the rate changes with time.


In oops what is the difference between class variable and variable?

Class Variable is a subset of Variables.


What is the difference between the experimental variable and the controlled variable?

gago kayo


What is the difference between a variable and a rule?

a variable changes a rule doesn't.


What is one difference between a variable expression and a numerical expression?

The variable.