printf打印(u8/.../int/.../float)各类型方法

  给出打印格式:

 

   给出定义类型:

 1 /* bsd */
 2 typedef unsigned char        u_char;
 3 typedef unsigned short       u_short;
 4 typedef unsigned int         u_int;
 5 typedef unsigned long        u_long;
 6 
 7 /* sysv */
 8 typedef unsigned char        unchar;
 9 typedef unsigned short       ushort;
10 typedef unsigned int         uint;
11 typedef unsigned long        ulong;
12 
13 #ifndef __BIT_TYPES_DEFINED__
14 #define __BIT_TYPES_DEFINED__
15 
16 typedef        __u8                u_int8_t;
17 typedef        __s8                int8_t;
18 typedef        __u16        u_int16_t;
19 typedef        __s16        int16_t;
20 typedef        __u32        u_int32_t;
21 typedef        __s32        int32_t;
22 
23 #endif /* !(__BIT_TYPES_DEFINED__) */
24 
25 typedef        __u8                uint8_t;
26 typedef        __u16          uint16_t;
27 typedef        __u32        uint32_t;
28 
29 #if defined(__GNUC__)
30 typedef        __u64        uint64_t;
31 typedef        __u64        u_int64_t;
32 typedef        __s64        int64_t;
33 
34 typedef signed char s8;  
35 typedef unsigned char u8;  
36   
37 typedef signed short s16;  
38 typedef unsigned short u16;  
39   
40 typedef signed int s32;  
41 typedef unsigned int u32;  
42   
43 typedef signed long long s64;  
44 typedef unsigned long long u64;     
posted @ 2021-03-30 19:00  `Konoha  阅读(3083)  评论(0编辑  收藏  举报