struct vec3{
vec3(){x=y=z=0.0f;};
float x,y,z;
};
vec3 array[10];
char buffer[100];
memcpy(buffer, array, sizeof(array));
memcpy(array, buffer, sizeof(array));
struct Vec3 is not Plain Old Datatype (POD type).
Is it this code correct and/or is it exist some garantees about memory layout in C++2003?
Not in C++03, but in C++11 this is fine.
They introduced a concept called standard-layout, which is really what POD should have been. I won’t go into the standardese, but the new category is the recognition that your class is really just a POD with a new way of initializing it; the layout is still the same, hence the name “standard layout”.
So most (all?) of those things that used to be POD only are now standard-layout only, so you’re good to go.
In practice this works fine in C++03 compilers; you can view this as them supporting C++11 in some way.