This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cerr not defined


Bjorn,
thank you, things are beginning to become clear.

It would appear that there was an error in the Stroustrup book
where "std::" was left off "cerr" so that it should have been:
std::cerr << P << ' ' << P2 << '\n';

for emitting the error message.

This would have placed cerr in the std namespace which is 
where<fstream> places it as opposed to <fstream.h>.

Since I am new to g++ and C++ can anyone clue me into when
C++ standards changed, and g++ header files were 
relocated/changed?
I just need to get my bearings so I know how to distinquish between
"old" and "new".

Thanks,
Shane


On 20 Jan 2003 at 22:17, bjorn rohde jensen wrote:

> Hi Shane,
> 
>   You are not actually using
> 
> #include<fstream.h>
> 
> but
> 
> #include<fstream>
> 
> The former usually populates the global
> namespace, but the later uses namespace std.
> 
> Yours sincerely,
> 
> Bjorn
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]