是什么的#include℃之间的差异;文件名>和&#包括QUOT;文件名"? [英] What is the difference between #include <filename> and #include "filename"?

查看:155
本文介绍了是什么的#include℃之间的差异;文件名>和&#包括QUOT;文件名"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C和C ++编程语言,是用尖括号,并在包含语句中使用引号之间的区别,如下所示?


  1. 的#include<&名GT;

  2. 的#include文件名


解决方案

所不同的是在位置,所包含的文件preprocessor搜索。

有关的#include文件名的preprocessor在同一目录作为包含指令的文件搜索。这种方法通常用于包括程序员定义的头文件。

有关的#include<文件名> 在执行依赖性preprocessor搜索,通常在搜索目录$ P $编译器/ IDE对指定。这种方法通常用于包括标准库的头文件。

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"

解决方案

The difference is in the location where the preprocessor searches for the included file.

For #include "filename" the preprocessor searches in the same directory as the file containing the directive. This method is normally used to include programmer-defined header files.

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.

这篇关于是什么的#include℃之间的差异;文件名&GT;和&#包括QUOT;文件名&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆