The Architect The Architect - 1 year ago 131
C++ Question

Error using std::cout in visual cpp console application

I am using visual studio 2013 to build a C++ console application.This is my code which gives an error. I need to write to the console for every function in my application.

// RAT.cpp : Defines the entry point for the console application.

#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
std::cout << "Process started";
return 0;

It gives the following error,

Error:namespace "std" has no member "cout"

I dont understand why this basic "cout" gives a such error :(
Please help me I am totally confused....

Answer Source

You need to place include <iostream> as your header.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download