Compiler errors 编程新手,can';无法让visual studio 2013打开包含文件 我正在经历一个缓慢的学习C++代码的过程,我遇到了一个让我完全难堪的问题。

Compiler errors 编程新手,can';无法让visual studio 2013打开包含文件 我正在经历一个缓慢的学习C++代码的过程,我遇到了一个让我完全难堪的问题。,compiler-errors,fatal-error,Compiler Errors,Fatal Error,我正试图从www.stroustrup.com/Programming/std_lib_facilities.h保存一个自定义头,并获取我的.cpp文件以在目录中打开它。我已经将标题保存在与.cpp文件相同的目录中,这就是VS中的代码 #include <header1.h> int main() { cout << "its bumming me out pretty bad\n"; return 0; } #包括 int main() { cout

我正试图从www.stroustrup.com/Programming/std_lib_facilities.h保存一个自定义头,并获取我的.cpp文件以在目录中打开它。我已经将标题保存在与.cpp文件相同的目录中,这就是VS中的代码

#include <header1.h>

int main()
{
    cout << "its bumming me out pretty bad\n";
    return 0;
}
#包括
int main()
{

cout首先,包括如下内容:

#include "header1.h"
如果不包含iostream,您就无法使用cout,因此它最终看起来应该是:

#include "header1.h"
#include <iostream>
using namespace std;

int main()
{
    cout << "its bumming me out pretty bad\n";
    return 0;
}
#包括“header1.h”
#包括
使用名称空间std;
int main()
{

cout首先,包括如下内容:

#include "header1.h"
如果不包含iostream,您就无法使用cout,因此它最终看起来应该是:

#include "header1.h"
#include <iostream>
using namespace std;

int main()
{
    cout << "its bumming me out pretty bad\n";
    return 0;
}
#包括“header1.h”
#包括
使用名称空间std;
int main()
{
cout符号
告诉编译器您引用的是标准头,并且它的完整路径是已知的(即,它位于VS的默认位置,或者您手动包含该路径)

使用双引号
#include“header1.h”
引用存储CPP的文件夹。

符号
告诉编译器您引用的是标准头,并且它的完整路径是已知的(即,它位于VS的默认位置或您手动包含该路径)

使用双引号
#包括“header1.h”
引用存储CPP的文件夹。

使用
#包括“header1.h”
请参阅使用
#包括“header1.h”
请参阅