假设我有一个 C/C++ 结构
struct ABCTYPE
{
double A;
double B;
double C;
};
是否确保在任何类型的现代平台上都没有额外的填充?
更具体地说,如果我使用
std::vector<ABCTYPE> storage;
// add some elements
// now i need some C routines to the data
double* param=&(storage[0]);
c_routine(param); // Tested OK on Win/Linux, but will it work on any platforms?