重复:
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/