C中的代码中间包含了什么? [英] What does the include in the middle of code in C?

查看:108
本文介绍了C中的代码中间包含了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请,
你能告诉我下面的代码是做什么的吗?

Please, could you tell me what does the code below do?

...code...
#include file.h
...code...

我曾经习惯于把每个文件包括起来。我以前从未见过这个,也无法在互联网上找到任何东西。

I was used to put includes a the beggining of each file. I have never seen this before and also wasn't able to find anything in the internet.

推荐答案

#include 是一个预处理器指令,它将给定的文件作为参数并将其内容转储到当前文件中。通常,这用于包含头文件中公共函数的定义,但没有必要以这种方式使用它。

#include is a pre-processor directive that takes the file given as the argument and dumps its contents in the current file. Typically, this is used to include definitions of commons functions from header files, but there's no necessity to use it in that way.

这篇关于C中的代码中间包含了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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