The expression sizeof *pos
is the same as sizeof(*pos)
, and gives the size of the thing that pos
points at. If pos
is dynamically allocated, it will give you the size of each element.
So for example:
float *pos = new float[N_VERTS * P_SIZE];
// ... fill in pos values
size = N_VERTS * P_SIZE * sizeof *pos;
will give the size of the memory allocated for pos
in bytes.
In your case, since your data is not dynamically allocated, you could use sizeof pos
.