|
From: Napoleon A. <nah...@so...> - 2002-06-29 16:13:33
|
Hello and thanks, I don,t know what I'm doing wrong but all I've done is create a console project with the source code. and when I compile I get the following error still: /C++Lab/Temp/test.cpp C:\C++Lab\Temp\C In constructor `World::World(int)': 10 C:\C++Lab\Temp\test.cpp `cout' undeclared in namespace `std' I'm still scratching my head . Napoleon. ----- Original Message ----- From: "Rob Andrews" <ro...@us...> To: "Napoleon Ahiable" <nah...@so...> Sent: Saturday, June 29, 2002 4:48 PM Subject: Re: [Dev-C++] Error using std::cout > I just pasted your code into a blank source file on Dev-C++ 4.9.4.0 and > compiled it without problem. Here's the output: > > Hello from 1. > Hello from 2. > Hello from main! > Good bye. > Good bye. > > Rob Andrews > http://uselesspython.com > > Napoleon Ahiable wrote: > > > Hello, > > > > > > > > I just tried to compile this program and I had an error saying cout not > > declared: > > > > > > > > > > #include <iostream> > > #include <stdlib.h> > > > > > > > > using std::cout; > > > > > > > > class World > > { > > public: > > World (int i) > > { > > std::cout << "Hello from " << i << ".\n"; > > } > > > > > > > > ~World () > > { > > std::cout << "Good bye.\n"; > > } > > }; > > > > > > > > World TheWorld (1); > > > > > > > > int main() > > { > > World myWorld (2); > > std::cout << "Hello from main!\n"; > > } > > > > > > > > I'll appreciate any help you can give me. > > > > > > > > Napoleon. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.372 / Virus Database: 207 - Release Date: 20/06/02 |