我试图提取两个 (int32_t) 值,并将它们放在一个 char 数组中。
int32_t version = getVersion();
if (version < 0)
{
return;
}
else
{
//first part of number needs to be shifted right
int32_t major = (((version) >>16) & 0xFFFF);
int32_t minor = ((version) & 0xFFFF);
// need to concatenate these two values, and place a "." between them
setVersion(...);//requires a char array, should for example be "1.1"
}
谁能给我任何建议以最好的方式做到这一点?请不要使用 std::strings 。我更喜欢 char 数组。
提前致谢