什么是头文件在C点? [英] What are the point of header files in C?

查看:144
本文介绍了什么是头文件在C点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能显示的文件:结果
   [C]每个源文件头。结果
  在C ++中为何头文件和cpp文件?结果
   C ++ - 什么应该进入一个.h文件中

时的唯一理由在存在C头文件是这样开发人员可以快速查看可用的功能,他们可以采取哪些参数?又或者是做的编译器?

Is the only reason header files exist in C is so a developer can quickly see what functions are available, and what arguments they can take? Or is it something to do with the compiler?

为什么用这种方法没有其他的语言吗?难道只是我,还是它似乎有2套函数定义只会导致更多的维护和更多的空间的错误?抑或是寂寂头文件只是一些每一个C开发人员必须知道吗?

Why has no other language used this method? Is it just me, or does it seem that having 2 sets of function definitions will only lead to more maintenance and more room for errors? Or is knowing about header files just something every C developer must know?

推荐答案

头文件是需要的声明的可用函数和变量。您可能没有访问定义(=的.c文件)的所有的; C支持二进制只有在库code的分布情况。

Header files are needed to declare functions and variables that are available. You might not have access to the definitions (=the .c files) at all; C supports binary-only distribution of code in libraries.

这篇关于什么是头文件在C点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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