?yb? 2008-08-22 01:40 采纳率: 0%
浏览 613

# include filename 和 # include"filename"之间的区别是什么?

In the C and C++ programming languages, what is the difference between using angle brackets and using quotes in an include statement, as follows?

  1. #include <filename>
  2. #include "filename"

转载于:https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename

  • 写回答

30条回答 默认 最新

  • 笑故挽风 2008-08-22 01:40
    关注

    In practice, the difference is in the location where the preprocessor searches for the included file.

    For #include <filename> the preprocessor searches in an implementation dependent manner, normally in search directories pre-designated by the compiler/IDE. This method is normally used to include standard library header files.

    For #include "filename" the preprocessor searches first in the same directory as the file containing the directive, and then follows the search path used for the #include <filename> form. This method is normally used to include programmer-defined header files.

    A more complete description is available in the GCC documentation on search paths.

    评论

报告相同问题?