1

私はC ++を学ぼうとしていますが、「cout」や「cin」のような単純な方法は存在しません。これは私のコードです:

#include "stdafx.h"
#include <iostream>


int _tmain(int argc, _TCHAR* argv[])
{
    cout>>"hello";
    return 0;
}

「エラー C2065: 'cout' : 宣言されていない識別子」というエラーがあります。

および "IntelliSense: 識別子 "cout" は定義されていません"

4

4 に答える 4

0

cout入っstdていますのでご使用using namespace stdください。そして for coutoperator は のようなもの<<です。>> これは入力用cinです。

#include "stdafx.h";
#include "iostream";
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    cout<<"hello";
    system("pause");
    return 0;
}
于 2016-08-11T18:46:19.163 に答える