【发布时间】:2016-08-03 17:34:14
【问题描述】:
我正在尝试使用 gmp_printf() 以十六进制打印,但由于某种原因它不起作用/工作异常。
mpz_t B; //number of bytes
mpz_set_str(B,argv[2],0);
gmp_printf("%Zd",B);
工作正常。
尝试将其更改为:
gmp_printf("%#0xZd",B);
但是使用这个我会为相同的输入得到不同的输出:
input: 0x397a52dccd55d39823964ae25
output1: 0xa8392f80Zd
output2: 0xa1eca3b0Zd
desired output: 0x397a52dccd55d39823964ae25
【问题讨论】: