【C++】cout 定義されていない識別子です。
'cout': 定義されていない識別子です。 'endl': 定義されていない識別子です。
3連休でC++を学習しようと、早速環境を整えたら…
こんなエラー文が出てC++のHelloWorldが実行出来なかった。
#include <iostream> #include "stdafx.h" using namespace std; int main() { cout << "This is a test.\n" << endl; return 0; }
#include iostreamとusing namespace std;の間に#include "stdafx.h"を挟んでいるのが原因っぽい。
iostreamはヘッダファイルとはまた違う、ヘッダという存在。