我有以下结构
struct {
int myData;
int myAnotherData;
}Value;
struct AnotherStructure {
unsigned int uiLowData;
unsigned int uiHighData;
};
AnotherStructure m_AnotherStructure;
Value val;
val.myData = 10;
#define MULTIPLY 36000000000
unsigned __int64 &internalStructure = *(unsigned __int64*)&m_AnotherStructure;
internalStructure = 0;
internalStructure += ((unsigned __int64)val.myData * MULTIPLY );
我的问题是在上述情况下是否存在任何数据溢出,因为我们将 unsigned int 与大值相乘,结果是否存储在 unsigned int 类型的临时值中,然后存储在 int 64 中?如果现在怎么不会有任何溢出?
谢谢