answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
User Avatar

Humdan Asif. Com

Lvl 1
1y ago
Jo question search kry exact answer dy

Add your answer:

Earn +20 pts
Q: What is array What is difference between array and simple variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between an array shift and unsetting a variable in PHP?

By shifting the values in an array, you are moving a key's value to the previous key. The very first key's value is obliterated. By shifting all values in the array, all keys will have a value of NULL. Unsetting a variable is entirely different -- performing a variable unsetting causes the variable to have a value of NULL, as if it was never set.


Difference between array and pointers in c plus plus?

A pointer is simply a variable that can store a memory address and has the same purpose in both languages. The only real difference is that C++ pointers can point at objects (instances of a class) and indirectly invoke their methods, whereas pointers in C (which is not object oriented) cannot.


What is the difference between array element and variable?

• Array is the set of an multiple values where as variable can store single value at a time.• The difference between the definition of array and ordinary variable is the, array is always declared, initialized, and accessed using subscript whereas ordinary variable do not have any subscript.• The syntax for ordinary variable definition is data_type v1, v2, ….;• And the syntax for array variable is data_type v1[N1],v2[N2],…; where v1,v2 are name of variable and N1, N2 are the integer constants indicating the maximum size of array.


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


How array differ from ordinary variable?

ordanry variable store one value at a time. arrays are used for storing more than one value at a time in a single variable name ordanry variable doesnt have subscript. array must have subscript syntax for ord. variable Datatype v1,v2...... syntax for array variable Datatype v1[n1],v2[n2].....

Related questions

What is the difference between an array element and a variable?

Array elements are all members of the same variable, indexed in a logical manner. variables are distinct objects which must be referred to distinctly. The main functional difference is that a program can iterate over an array without the programmer knowing the original size of the array or explicitly which member to access.


What is the difference between an array shift and unsetting a variable in PHP?

By shifting the values in an array, you are moving a key's value to the previous key. The very first key's value is obliterated. By shifting all values in the array, all keys will have a value of NULL. Unsetting a variable is entirely different -- performing a variable unsetting causes the variable to have a value of NULL, as if it was never set.


What is difference between key and index in php arrays?

A key is the name of a variable in an array ($array["key"]) and the index is the position it's at ($array = ["key" => 0], the index would be 0). Keys and indices are the same if the array is not associative though ($array = [true], the key holding the value true is named 0 and is at index 0).


Difference between 1D array and 2D arrays?

1d array contains single row and multiple columns and 2d array contains multiple row and multiple columns. 2d array is a collection of 1d array placed one below another,while 1d array is simple a collection of elements.


Difference between array and pointers in c plus plus?

A pointer is simply a variable that can store a memory address and has the same purpose in both languages. The only real difference is that C++ pointers can point at objects (instances of a class) and indirectly invoke their methods, whereas pointers in C (which is not object oriented) cannot.


What is the difference between numeric array and associative array?

Numeric array has numbers(+integers) that represent the values Associative array has strings that represent the values


What is the difference between array element and variable?

• Array is the set of an multiple values where as variable can store single value at a time.• The difference between the definition of array and ordinary variable is the, array is always declared, initialized, and accessed using subscript whereas ordinary variable do not have any subscript.• The syntax for ordinary variable definition is data_type v1, v2, ….;• And the syntax for array variable is data_type v1[N1],v2[N2],…; where v1,v2 are name of variable and N1, N2 are the integer constants indicating the maximum size of array.


What is the difference between array and string of array?

When we declare an array of characters it has to be terminated by the NULL , but termination by NULL in case of string is automatic.


Difference between vector and array list?

Vectors are thread safe but array lists are not. Hence array lists are faster than Vectors.


What is the difference between Land Grid Array and Pin Grid Array?

One has pin in front, one has land


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


What is Difference between programmable logic array and programmable array logic?

Using and gate - pla is programmable while pal is fixed