Convert uintmax_t into string c
How to convert uintmax_t into st开发者_如何学Goring in C?
You'd use sprintf to convert to a string. For a type such as uintmax_t , the inttypes.h header contains printf conversion specifiers for these types.
#include <stdint.h>
#include <inttypes.h>
#include <stdio.h>
int main(int argc,char *argv[])
{
char str[64];
uintmax_t i = 123456;
sprintf(str,"Value is %" PRIuMAX "\n",i);
puts(str);
return 0;
}
精彩评论