我想拥有相当于
void print3( char a, uint8_t b, int8_t c )
{
printf("%c %" PRIu8 " %" PRIi8 "\n", a, b, c);
}
使用write系统调用。问题是,我不知道如何使用 write. 只允许来自 ANSI C 的命令,并且sprintf禁止使用格式化字符串。
使用 write 的示例语法:
const char msg[] = "Hello World!";
write(STDOUT_FILENO, msg, sizeof(msg)-1);
编辑:我不允许sprintf使用itoa.
