Difference between an array and an associative array

Here's my understanding of an associative array: The values are allotted to array slots based on some function. In order words, integer 560 would be allotted at an index position determined by some function. So is that it? The only difference between an array and an associative array is that values are allotted to a simple array starting at index 0 all the way up to ARRAYSIZE - 1, whereas in an associative array values are allotted to positions determined by some function.
Last edited on
The difference is that arrays are indexed by integers, whereas associative arrays can be indexed by any data type. This may be implemented the way you're describing, or it may be implemented some completely different way.
Topic archived. No new replies allowed.