   Which would be more efficient/better practise?
  Hi, i have a program with two similar structures, a firework structure and a firework particle structure. the firework structure represents a firework before it has exploded, and the firework particles are created once the firework has exploded. Both contain many similar attributes (eg. x and y velocities). My question: I want to update the velocities of both these structures, however because they are declared as different structs i cannot do this in one function.I currently have a function to update the velocity of the firework looking like this:void updateVelocity(firework * fwork, float timeStep){    fwork->vel.x += fwork->acc.x * timeStep;    fwork->vel.y += fwork->acc.y * timeStep;}Would i be better off making another function as above, except just pass it a firework particle instead of a firework or would it be better when i want to update firework particle velocities to copy the x and y values to a temporary firework struct and pass that to the above function before copying the updating values back to my firework particle?Hope i made myself clear.I am programming in C by the way.   
struct vector2d{  float x, y;};struct particle{  struct vector2d pos, vel;};struct firework{  struct particle part;};struct firework_particle{  struct particle part;};void particle_update(struct particle *p, float timeStep){  p->pos.x += timeStep * p->vel.x;  p->pos.y += timeStep * p->vel.y;}then simply do:struct firework fw;struct firework_particle fwp;particle_update( &fw.part);particle_update( &fwp.part);/* not that if you make sure to put the particle struct as the first member you could safely do */particle_update( &fw);particle_update( &fwp);/* both saving some typing and giving an illusion of polymorphism in plain C :) */;  good thinking :) thanks   