I'm trying to learn c++ but a simple method like "cout" and "cin" does not exist this is my code:
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
cout>>"hello";
return 0;
}
there is an error that says "error C2065: 'cout' : undeclared identifier"
and "IntelliSense: identifier "cout" is undefined"
std::cout << "hello". - Bill Careycoutis in thestdnamespace. Trystd::cout << "hello";- Praetorianstd::and you mixed up>>and<<. - Rapptzcout<<"hello";tostd::cout << "hello";-- or, better yet,std::cout << "hello\n";. You could drop thestd::by addingusing namespace std;; you'll see a lot of code that does that, but it's often considered to be a bad habit. - Keith Thompson