This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: cerr not defined
shane@shaneroberts.com writes:
[snip]
> 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';
If you browse the book, you will see that std:: is omitted everywhere
on the source listings. If it appears somewhere, it's a typo. The
author explains somewhere that this is done on the sake of clarity. He
also says, IIRC, that the reader shall assume that every program has a
"using namespace std;" on top of it.
> 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?
So far there is only one C++ standard, dated 1998. The 'std::' thing
is there.
> I just need to get my bearings so I know how to distinquish between
> "old" and "new".
[snip]
--
Oscar