The difference between C language learning _include<> and include ""

Source: Internet
Author: User

Often encounter two kinds of include reference header file case, in fact, the difference is very simple, as follows:

First, #include < >

#include < > refers to the header file inside the compiler's class library path.

If your compiler-defined self-lead file is referenced below C:\Keil\c51\INC\, then #include <stdio.h> reference is C:\Keil\c51\INC\stdio.h this header file, no matter what directory your project is in, C \ Keil\c51\inc\stdio.h This path is settled, usually refers to some of the header files, such as: Stdio.h, Conio.h, String.h, stdlib.h and so on.

Second, #include < >

#include "" refers to the header file in the relative path of your program directory.

If your project directory is in D:\Projects\tmp\, then #include "my.h" refers to the D:\Projects\tmp\my.h header file, which is generally used to refer to some of their own written header files. If you use the #include "", it will be in your project's current directory to find out if there is a corresponding header file, if not, it will be in the corresponding reference directory to find the corresponding header file. For example, using the #include "stdio.h" if there is no stdio.h this header file in your project directory, it will still be positioned to C:\Keil\c51\INC\stdio.h this header file.

The difference between C language learning _include<> and include ""

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.