根据严格别名规则: struct B { virtual ~B() {} };
struct D : public B { };
D d;
char *c = reinterpret_cast<char*>(&d);
char*一个不同类型的任何对象是有效的。但现在的问题是,它是否会指向& d的相同地址? C++ Standard保证它会返回相同的地址是什么?
假设我有一个范例源文件test.c的,这我编译如下所示: $ GCC -03 -Wall 测试。 ç看起来是这样的.. /// CMP128(x, y)
//
// arguments
// x - any pointer to an 128-bit int
// y - any pointer to an 128-bit int
//
// returns -1, 0, or 1 i