ゲームが作れるようになるまでがんばる日記

ゲーム制作のことを中心にゲームに関することを書いています

cin,cout

ちょっとしたテストプログラムを書こうと思って、Visual C++ 2005 Express Editionでコーディング。入出力にcin,coutを使おうとしたらコンパイルエラーが。

#include <iostream>

int main()
{
    cout << "test" << endl;
}

cin,coutはstdというnamespaceで定義されているので、std::を付けるか、usingが必要。

std::cout << "test" << endl;
using namespace std;