我正在学习C语言的工作原理。我可以在<stdlib.h>
中找到像int8_t
、intptr_t
等类型的定义:
// Represents true-or-false values
typedef _Bool bool;
enum { false, true };
// Explicitly-sized versions of integer types
typedef __signed char int8_t;
typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
// Pointers and addresses are 32 bits long.
// We use pointer types to represent virtual addresses,
// uintptr_t to represent the numerical values of virtual addresses,
// and physaddr_t to represent physical addresses.
typedef int32_t intptr_t;
typedef uint32_t uintptr_t;
typedef uint32_t physaddr_t;
然而,我找不到像char
这样的类型的定义。因此我的问题是,int
和char
是在哪里定义的?
typedef __signed char int8_t;
而不是typedef signed char int8_t;
?(去掉了__
) - chux - Reinstate Monica