我正在研究C语言是如何工作的。我可以找到类似类型的定义int8_t
, intptr_t
等在<stdlib.h>
:
// 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
and char
定义?
头文件在哪个char
定义?
无处可去-char
is a builtin类型,而不是用户自定义一。它是核心语言的一部分。这同样适用于int
.
难道这些都没有定义吗?builtin types?
有。该标准确实定义了这些内置类型。
请注意,两者char
and int
也都是keywords,这意味着你不能将它们用作身份标识,因为它们在语言中具有保留且已分配的用途。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)