Arrays or structures? What would you choose?

Everything else that doesn't fall into one of the other PB categories.
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Arrays or structures? What would you choose?

Post 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.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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.
Post Reply