C++ #include <[filename]> 但#include <string> 不是文件名

标签 c++ include

重复:
When can you omit the file extension in an #include directive?


发现后感觉自己聪明了一点:
What is the difference between #include <filename> and #include "filename"?

但在我的代码中我使用 #include <string> .
string不是有效的文件名,尖括号未放在 "" 中.

这是包含其他文件的第三种方式还是我必须如何理解它?
换句话说,什么是 <string> ?

最佳答案

string is not a valid filename

是的。头文件的名字就是字面上的string。搜索您的包含路径,e。例如:

find /usr/include /usr/local/include -name "string"

你会得到一些结果。

关于C++ #include <[filename]> 但#include <string> 不是文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30752085/

相关文章:

c++ - 将缺少的左括号添加到等式中

c++ - -masm=intel 标志不适用于使用 Intel 语法在 gcc 编译器中运行汇编语言

c++ - 创建一个模板来包装 C++ 成员函数并公开为 C 回调

c++ - 编译失败 - 没有#include - boost

php - 将一些电子邮件包含在一个电子邮件中

c++ - 在 C++ 中使用不同的 IEEE 浮点舍入模式

C++ 将 memcpy 转换为 std::copy

hibernate - 如何在 JPA 实体中定义非聚集索引 include 子句

PHP: 'include' , 但不要运行

c++ - 在 .vcproj RelativePath 中使用 "User Macro"