What will happen if I don't include header files

前端 未结 5 2048
误落风尘
误落风尘 2020-12-06 08:08

What will happen if I don\'t include the header files when running a c program? I know that I get warnings, but the programs runs perfectly.

I know that the header f

5条回答
  •  一生所求
    2020-12-06 08:53

    First of all: just include them.

    If you don't the compiler will use the default prototype for undeclared functions, which is:

    int functionName(int argument);
    

    So it will compile, and link if the functions are available. But you will have problems at runtime.

提交回复
热议问题