Snprintf на ARM64 и x64 (g++) [дубликат] ⇐ Linux
-
Гость
Snprintf на ARM64 и x64 (g++) [дубликат]
I'm porting existing project code from x64 Linux to equivalent ARM64 machine. However, the function snprint has different outputs on the two platforms. I've reduced my problem down to this small function:
#include #include int main() { const char* input = "-126"; const int toint = atoi(input); char* intBuff = (char*)malloc(1); intBuff[0] = toint; char buffer[10]; snprintf(buffer, sizeof(buffer), "%d", intBuff[0]); std::cout
Источник: https://stackoverflow.com/questions/781 ... 4-vs-x64-g
I'm porting existing project code from x64 Linux to equivalent ARM64 machine. However, the function snprint has different outputs on the two platforms. I've reduced my problem down to this small function:
#include #include int main() { const char* input = "-126"; const int toint = atoi(input); char* intBuff = (char*)malloc(1); intBuff[0] = toint; char buffer[10]; snprintf(buffer, sizeof(buffer), "%d", intBuff[0]); std::cout
Источник: https://stackoverflow.com/questions/781 ... 4-vs-x64-g
Мобильная версия