32bit/64bit両対å¿ã®ã³ã¼ããæ¸ãã¦ããã¨ï¼ãã printf() ã§å¼ã£ãããã¾ãï¼"%d"ã®ãããª"æ¸å¼"ããããããããã§ãï¼
ã¨ããããã§ï¼å¤æ°ã®"å"ã¨"æ¸å¼"ã®å¯¾å¿ãï¼è¡¨ã§æ´çãã¦ã¿ã¾ããï¼
å | æ¸å¼ | 注æäºé |
ssize_t | %zd | |
size_t | %zu | |
intmax_t | %jd | |
uintmax_t | %ju | |
ptrdiff_t | %t | |
signed char | %hhd | |
unsigned char | %hhu | |
short int | %hd | |
unsigned short int | %hu | |
int | %d | |
unsigned int | %u | |
long int | %ld | |
unsigned long int | %lu | |
long long int | %lld | |
unsigned long long int | %llu | |
int32_t | %PRId32 | 以ä¸ï¼#include |
uint32_t | %PRIu32 | |
int64_t | %PRId64 | |
uint64_t | %PRIu64 |
è£è¶³1: 16é²æ°çã®è¡¨ç¤º
- 16é²è¡¨ç¤ºã®å ´å㯠ä¸è¡¨ã®"u" ã "x" ã«ç½®ãæããï¼ä¾ï¼"%lu" â "%lx"
- 8é²æ°è¡¨ç¤ºã®å ´å㯠ä¸è¡¨ã®"u" ã "o" ã«ç½®ãæããï¼ä¾) "%lu" â "%lo"
è£è¶³2: inttypes.hã®ä½¿ãæ¹
#define __STDC_FORMAT_MACROS #include <inttypes.h>
ã¾ãã¯
#include <cinttypes>
ã¨ã½ã¼ã¹ã³ã¼ãã«æ¸ãï¼
Linuxããã°ã©ãã³ã°âä¾é¡ã§å¦ã¶UNIXããã°ã©ãã³ã°ç°å¢ã®ãã¹ã¦
posted with amazlet at 11.05.31
ãã¼ã« ãã·ã¥ã¼ ãªãã£ã¼ã ã¹ãã¼ã³ãº
ã½ãããã³ã¯ã¯ãªã¨ã¤ãã£ã
売ãä¸ãã©ã³ãã³ã°: 228430
ã½ãããã³ã¯ã¯ãªã¨ã¤ãã£ã
売ãä¸ãã©ã³ãã³ã°: 228430