我有以下代码。sprintf 中第二个 %d 的输出始终显示为零。我想我指定了错误的说明符。任何人都可以帮助我获得具有正确值的写入字符串。这必须在posix标准中实现。感谢您的投入
void main() {
unsigned _int64 dbFileSize = 99;
unsigned _int64 fileSize = 100;
char buf[128];
memset(buf, 0x00, 128);
sprintf(buf, "\nOD DB File Size = %d bytes \t XML file size = %d bytes", fileSize, dbFileSize);
printf("The string is %s ", buf);
}
输出:
The string is
OD DB File Size = 100 bytes XML file size = 0 bytes