What is the difference between #include <filename> and #include "filename"?

Asked 2 years ago, Updated 2 years ago, 47 views

The method of including C/C++ is to use <> and " There are two. What's the difference between the two?

c c++ include prepocessor

2022-09-22 13:51

1 Answers

The preprocessor is looking for a file to include in a different location.

#include "filename" looks for header files in the same directory as the source file. It is mainly used when include header files defined by the programmer.

#include<filename> depends on how it is implementedten thousand Typically, the compiler/IDE looks for header files in a pre-created directory. It is mainly used when include the standard libaray header file.


2022-09-22 13:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.