One article to understand the difference between #include< > and #include” ”

The difference between include<> and #include ""

一、#include< >

#include<> refers to the header files in the class library path of the compiler.

If the self-contained header file defined by your compiler is quoted under C:\Keil\c51\INC\, then #include<stdio.h> refers to the header file C:\Keil\c51\INC\stdio.h, regardless of In which directory your project is located, the path C:\Keil\c51\INC\stdio.h is determined, usually by quoting some of the included header files, such as: stdio.h, conio.h, string.h , Stdlib.h, etc.

二、#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 header file D:\Projects\tmp\my.h, which is generally used to quote some headers written by yourself file. If you use #include" ", it will first look for the corresponding header file in the current directory of your project. If not, it will still look for the corresponding header file in the corresponding reference directory. For example, use #include “stdio.h” If there is no header file stdio.h in your project directory, it will still locate the header file C:\Keil\c51\INC\stdio.h.

Guess you like

Origin blog.csdn.net/m0_45388819/article/details/110672600