The Object-Oriented way of organizing data. The struct contains individual data and then an Array of this struct is created.

struct Particle {
    float x, y, z;
    float velocity;
    int id;
};
std::vector<Particle> particles(1000);
  • Pros: High spatial locality if you need to access all properties of a single particle at once (e.g., updating a specific particle’s state).
  • Cons: Poor for SIMD vectorization. If you want to sum only the x coordinates of 1 million particles, the CPU must load the entire Particle struct into the cache, wasting bandwidth on y, z, velocity, and id.