Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prolems of using "cout" from "iostream" in Visual C++.NET

Status
Not open for further replies.

Lyubomyr

Programmer
Jul 23, 2005
21
UA
I've got problem of using "cout","cin" and others from iostream library. Using standard Wizard I formed Win32 Console Project.
I just wrote

cout<<"Hello World";

in _tmain fuction.
Compiler says

error C2065: 'cout' : undeclared identifier

Please write me some advice.
PS I checked in VC++6.0 everything is OK.
 
I found solution to that problem
the line
cout<<"Hello World";
should be replaced to
std::cout<<"Hello World"
This is new in VC++.net. In VC++6.0 it's simple 'course you just writing
#inlcude <iostream.h>
in stdafx.h
and using
cout<<"Hello World";



 
Warning:
This is new in VC++.net. In VC++6.0 it's simple 'course you just writing #inlcude <iostream.h>
Alas, it's a wrong sentence.
Old (non-standard) header <iostream.h> was (at least) deprecated in VC++ 6.0 (for dubious backward compatibility with old codes). There are no namespace std in old headers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top