加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

什么是C11标准的源文件

发布时间:2020-12-16 09:55:11 所属栏目:百科 来源:网络整理
导读:我对标准C11的这一段中的一句话有疑问: 5.1.1.1程序结构 A C program need not all be translated at the same time. The text of the program is kept in units called source ?les,(or preprocessing ?les) in this International Standard. A source ?le
我对标准C11的这一段中的一句话有疑问:

5.1.1.1程序结构

A C program need not all be translated at the same time. The text of
the program is kept in units called source ?les,(or preprocessing
?les) in this International Standard. A source ?le together with all
the headers and source ?les included via the preprocessing directive #include is known as a preprocessing translation unit.

起初它说程序的文本保存在称为源文件的单元中.
之后它说源文件连同头文件和源文件被称为预处理翻译单元.

那么源文件是否与头文件或源文件包含不同的实体?

解决方法

源文件是包含源代码的任何文本文件(或其他特定于实现的实体,根据Basile的答案).这特别包括.c和.h文件.它还可能包含具有其他后缀的文件,如预处理程序或生成的代码文件.

当您将一些源文件实际传递给编译器时(通常只有.c文件),该文件与(传递闭包)一起#includes形成一个翻译单元.

所以:每个翻译单元都是由源文件构建的.

但是:并非每个源文件都是翻译单元的起点.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读