<分区>
在我必须处理的包含旧代码的项目中,我有这个 Coord 结构。据我所知,它的大小应该是 12 个字节或 24 个字节。但是,sizeof(Coord
返回 40。有人可以解释这个额外大小的来源吗?
struct Coord
{
Coord();
float inate[3] = {0,0,0};
float& x = inate[0];
float& y = inate[1];
float& z = inate[2];
Coord operator*(const float&);
Coord operator=(const Coord&);
Coord operator=(const float[3]);
Coord dot(const Coord& c);
Coord cross(const Coord& c);
};