我有以下代码用于打印工作正常的 UUID:
void puid(uuid_t u)
{
int i;
printf("%8.8x-%4.4x-%4.4x-%2.2x%2.2x-", u.time_low, u.time_mid,
u.time_hi_and_version, u.clock_seq_hi_and_reserved,
u.clock_seq_low);
for (i = 0; i < 6; i++)
printf("%2.2x", u.node[i]);
printf("\n");
}
示例输出:
22b31d0d-4814-56e9-ba30-6c23d328deaf
我将如何构建一个 char 字符串来保存上述输出?