Home  >  Q&A  >  body text

c/c++ #include库函数后会使程序变大吗

java import不会使程序变大;
那c/c++ #include 库函数后会使程序变大吗?

阿神阿神2714 days ago573

reply all(4)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 14:38:33

    #include itself does not. What really makes the project bigger is the c, o and lib files in the project.

    But there is an exception, that is, if you put the function/method definition that should be placed in c into h, it will still become larger.

    In addition, the equivalent of import in Java should be using namespace.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 14:38:33

    Have a look at http://stackoverflow.com/ques...

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 14:38:33

    You will know after you try it. I remember that the libraries that come with c/c++ are dynamically loaded by default and should not become larger

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 14:38:33

    The default C library is dynamically linked, but it will definitely increase a bit because there is necessary information for dynamic linking and so on. If you choose a static link library, it will be much larger. In addition, if there are inline functions, macro expansion code, etc., the space will also be increased.

    reply
    0
  • Cancelreply