#include <***.h> "***.h" differs from #include when introducing header files in C + +

Source: Internet
Author: User

Two cases are differentiated:

1, #include <> compiler will only go to the System file directory to find, can not find the error.

2, #include "" The compiler will look in the user directory first, then to the compiler set directory to find, and finally to the system files in the directory to find.

The above points of attention:

1, Situation 1 for the system self-lead file

2, Situation 2 for users to write their own header files

3, both cases can theoretically be used in the form of #include ", but the standard header file or system header file use its form will lead to reduced compilation efficiency

4. In the C++11 standard, you should use angle brackets when you include standard header or system header files provided by C + +; You should use double quotation marks when you include a custom header file

5, the general C in the header file is ***.h; C + + in the header file without. h

#include <***.h> "***.h" differs from #include when introducing header files in C + +

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.