Page 1 of 1

Arrays or structures? What would you choose?

Posted: Thu Apr 28, 2005 4:53 am
by dagcrack
From experience, do you think Arrays are faster than Structures, or Structures are faster than arrays, and why you think so?

- This is a constructive poll! -

Structures or array ?

Given the case you would like to know the usage of the structures or the arrays, I'd say they are for storing data and later rapidly reading it, what would you choose?.

..As I've been using Structures for many data which is stored and later read at realtime and its really slow when you have a big amount of data.

Posted: Thu Apr 28, 2005 5:14 am
by Xombie
Arrays and structures are pretty different. If you're comparing something like that, wouldn't you compare arrays to linked list? A structure is used to store lots of data for 1 thing. An array is used to store lots of data for multiple things. For example, I use structures to store form configuration options so I can quickly access them all without having to have separate variables. Kind of like an organization thing. I use arrays for something like storing multiple strings. Arrays can be of a structure type.

So pretty different there. However, speed-wise I'd think they're both about the same time to access.