Mail Archives: djgpp/2003/01/28/09:20:20
Hello.
Lawrence Rust wrote:
>
> "Hans-Bernhard Broeker" wrote...
> > Y Chen <yc12 AT uow DOT edu DOT au> wrote:
> >
> > > #include <iostream>
> > > #include <cstdlib>
> > > //#include <fstream>
> > > using namespace std;
> >
> > > //#include <stdlib.h>
> > > #include <stdio.h>
> > > //#include <iostream.h>
> >
> > > #include <iomanip.h>
> > > #include <new.h> // for memory error handling
> >
> > This is a horrible mess. You're mixing new-style C++ standard headers
> > (without .h) and old-style ones (with .h). And on top of all that,
> > you throw C headers into the mix. While this may still work, if
> > you're lucky, it's a rather certain path to confusion. Please try to
> > avoid that.
>
> This is a criticism of the quagmire that has become the C++ standard
> (template) library. IMHO unless you are determined to wade through the
> nightmare of i/o streams and its inpenetrable templates then you are better
> off with C standard FILE's and printf/scanf.
[snip]
There are right and wrong ways of including stdio in C++ programs. The wrong
way is <stdio.h>. The right way is <cstdio>. This is what Hans-Bernhard means,
I think.
Regards,
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -