【C】数据类型定义

#include <stdint.h>

/* Unsigned. */
typedef unsigned char       uint8_t;
typedef unsigned short int uint16_t;
#ifndef __uint32_t_defined
typedef unsigned int        uint32_t;
# define __uint32_t_defined
#endif
#if __WORDSIZE == 64
typedef unsigned long int   uint64_t;

 

#include "stm32f10x.h"

typedef uint32_t  u32;
typedef uint16_t u16;
typedef uint8_t  u8;

  

按照posix标准,一般整型对应的*_t类型为:

1字节 uint8_t

2字节 uint16_t

4字节 uint32_t

8字节 uint64_t

 

posted @ 2018-05-09 14:37  KevinChase  阅读(201)  评论(0编辑  收藏  举报