标头实现插入的位置 [英] where does the header implentation get inserted

查看:84
本文介绍了标头实现插入的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有新手问候,


我写的时候


#include< somthing.h>


预编译器使用somthing.h中的行来划分该行。

头文件。

编译器何时,何地以及如何插入在我的源代码中将somthing.c>

实现文件中的行?


谢谢

amit

解决方案

am ****** @ gmail。 com 写道:


我有新手问候,


当我写作


#include< somthing.h>


预编译器使用somthing.h中的行来划分该行

头文件。

编译器何时,何地以及如何将somthing.c>

实现文件中的行插入到我的源代码中?


在典型的实现中预处理器生成一个中间的

文件或数据流,标题的内容包含在内,并将这个传递给编译器。


-

Ian Collins。


2006年9月16日14:56:36 -0700,在comp.lang.c , am******@gmail.com

写道:


>我有新手问候,

当我写作

#include< somthing.h> 头文件。
编译器何时,何地以及如何在somthing.c中插入行<<
实现文件到我的源代码?



它没有。


如果某事是一个库,构建过程将尝试链接

该库提取所需的机器代码以提供

函数。如果是某事是另一个源文件,你需要

告诉编译器也要编译它,然后告诉链接器链接

吧。

-

马克麦金太尔


调试的难度是首先编写代码的两倍。

因此,如果您尽可能巧妙地编写代码,那么,根据定义,它不够聪明,无法调试它。

--Brian Kernighan


am******@gmail.com 写道:


>

我写的时候


#include< somthing.h>


预编译器使用somthing.h中的行来划分该行。

头文件。

编译器何时,何地以及如何插入somthing.c中的行>

实现文件到我的源代码中?



在阅读源文件时动态。它不需要插入

任何东西,它只需要表现得就像它一样。


-

" The计算机软件行业最令人惊叹的成就

是它继续取消计算机硬件行业所取得的稳定和惊人的b $ b增长...... - Petroski


-

通过免费的Usenet帐户从 http://www.teranews.com


Hi, i have newbie qestion,

when i write

#include <somthing.h>

the precompiler subtitue that line with the lines from "somthing.h"
header file.
when, where and how the compiler insert the lines in "somthing.c"
implementation file into my source code?

thanks
amit

解决方案

am******@gmail.com wrote:

Hi, i have newbie qestion,

when i write

#include <somthing.h>

the precompiler subtitue that line with the lines from "somthing.h"
header file.
when, where and how the compiler insert the lines in "somthing.c"
implementation file into my source code?

In a typical implementation, the preprocessor generates an intermediate
file or data stream with header''s content included inline and passes
this to the compiler.

--
Ian Collins.


On 16 Sep 2006 14:56:36 -0700, in comp.lang.c , am******@gmail.com
wrote:

>Hi, i have newbie qestion,

when i write

#include <somthing.h>

the precompiler subtitue that line with the lines from "somthing.h"
header file.
when, where and how the compiler insert the lines in "somthing.c"
implementation file into my source code?

It doesn''t.

If "something" is a library, the build process will try to link with
that library to extract the machine code needed to provide the
functions. If "something" is another source file, you will need to
tell the compiler to compile it too, and then tell the linker to link
it.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan


am******@gmail.com wrote:

>
when i write

#include <somthing.h>

the precompiler subtitue that line with the lines from "somthing.h"
header file.
when, where and how the compiler insert the lines in "somthing.c"
implementation file into my source code?

On the fly, during reading of the source file. It need not insert
anything, it just has to act as if it did so.

--
"The most amazing achievement of the computer software industry
is its continuing cancellation of the steady and staggering
gains made by the computer hardware industry..." - Petroski

--
Posted via a free Usenet account from http://www.teranews.com


这篇关于标头实现插入的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆