5.1.1.1 C99 程序结构

5.1.1.1 Program structure in C99

A C program need not all be translated at the same time. The text of the program is kept in units called source files, (or preprocessing files) in this International Standard. A source file together with all the headers and source files included via the preprocessing directive #include is known as a preprocessing translation unit. After preprocessing, a preprocessing translation unit is called a translation unit. Previously translated translation units may be preserved individually or in libraries. The separate translation units of a program communicate by (for example) calls to functions whose identifiers have external linkage, manipulation of objects whose identifiers have external linkage, or manipulation of data files. Translation units may be separately translated and then later linked to produce an executable program.

我正在为粗体句而苦恼。我认为在考虑整个子句的流程时这句话似乎不合适(这个想法一定是错误的,因为它是 ANSI 的文档)。这可能是由于我的英语不好或缺乏计算机科学知识造成的。我用谷歌搜索了好几次,搜索了所有的单词和成语,但还是不知道。

Q1。 Previously translated translation units may be preserved only or in library.这句话和
previously preprocessed是同一个意思吗翻译单元可以单独保存,也可以保存在库中?
也就是说,句子中的translation units字和前一句完全一样吗?

Q2。 individually 是什么意思? ~ may be preserved individually.保存在什么地方??

如果我的问题不清楚或难以理解,你可以再给我解释说这句话指的是什么,而不是回答我的问题。感谢阅读我的问题。

正如您所指出的,我认为这是由于英语水平不佳所致。我会尝试给出我的解释,我自己不是以英语为母语的人。

你写代码。引用的指令声明代码存储在称为“源文件”或“预处理文件”的原子实体中。

然后将此代码编译成可执行文件或其他二进制形式。您以 human-readable 格式编写的“预处理文件”现在已转换为人类无法读取的二进制文件。

假设您的项目很大并且有多个源代码文件。您可能已经完成了项目的一部分,例如负责串行端口连接的部分。你编译它,现在你有了二进制文件。您可以 保留 这些二进制文件并将它们用作 并通过链接将它们导入项目的其余部分。

链接是在源代码中完成的,通过导入现有的东西,并在编译时创建 machine-level 链接。你没有re-compile串口连接,因为你把之前编译好的库保存了(供以后使用)。

二进制文件是一个文件,可能类似于library.olibrary.dll