C: Why do we include header files, which declare but don't define?

后端 未结 5 676
迷失自我
迷失自我 2021-01-14 07:59

At a high level, I understand we use #include statements to make code from other files available to the current file. But I don\'t understand why we include a h

5条回答
  •  天命终不由人
    2021-01-14 08:34

    The header files with a .h extension only includes the declarations of the functions. Its actual implementation is mentioned in a separate .c file. It is the .h file that further includes the .c file which is present in the .h file's local directory . Things will be even clearer if you try to do a project on compilers where you create your own header files

提交回复
热议问题