English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

arrays are used as a way of organizing, making sure that the correct data makes contact with the correct information given to it, i.e. make sure user 1234 is accessing user 1234's information, not user 6789's information. this also decreases the total amount of coding in a program, making it smaller, less work for the programmer, and more efficient. arrays also make it easier to organize file data that is being read by the program in the situation that more than one file is open at a time.

2007-12-03 05:39:40 · answer #1 · answered by Zee 4 · 0 1

Indexing the array is predictable when every element has the same data type, so you can find the n'th element fairly quickly. If you allow arbitrary mixed datatypes, the regularity of the index is spoiled, and you will end up with a queue, which takes much, much longer to locate arbitrary entries.

2007-12-03 05:42:08 · answer #2 · answered by Computer Guy 7 · 1 0

It's not strictly necessary. I can define a new Array of integers in javascript, and redefine one of the Array members as a character string. Javascript could care less. It depends upon what the instructions processing the Array expect.

In other cases, it could also be a matter of what sort of memory chunks are allocated to each array member.

2007-12-03 05:39:49 · answer #3 · answered by fjpoblam 7 · 0 0

fedest.com, questions and answers