|
From: lordSauron <lor...@gm...> - 2006-02-13 00:09:49
|
On 2/11/06, Per Westermark <pw...@ia...> wrote:
> You could use the iostream.h. Note that the cited message was a warning,
> not an error, and it explicitly said that the header you used was
> deprecated, i.e. not recommended for use anymore.
I just take that as a "don't use it - it's going to disappear soon!"
There was nothing *wrong* with your original code, save for the
#include -s and the lack of a using namespace std; Without namespace
std; - correct me if I'm wrong - you'd need to do iostream::cout
instead of a shorter cout call.
So, you could forgo the using namespace std;, however, you would need
to use iostream::cout and iostream::cin whenever trying to use
something found in the iostream include.
Also, to use system("pause"); you would need to include cstdlib (or
cstdlib.h, take your pick). If you didn't use using namespace std;
you would also need to use cstdlib::system("pause"); to make that
system call. Also note that system("pause"); is only valid on MS DOS
machines, since the pause command is not found in other shells like
bash.
That's my $0.02.
> The file conio.h on the other hand is a non-standard file, i.e. a file
> that have only existed on some platforms (normally old MS-DOS compilers).
> Since most compilers does not have this file, it shouldn't - and in most
> cases can't - be used.
>
> /Per W
>
> On Fri, 10 Feb 2006, Titi Anggono wrote:
>
> > Hi all,
> >
> > I just tried dev-cpp 4.9.9.2 today and began with
> > ----------------
> > #include <iostream.h>
> > #include <conio.h>
> > main()
> > {
> > cout <<"Hello word";
> > getch();
> > }
> > -----------------
> > the code wasn't compiled and I got following message "
> > #warning This file includes at least one deprecated or
> > antiquated header. Please consider using one of the 32
> > headers found in section 17.4.1.2 of the c++ standard.
> > ..."
> >
> > But, when I used stdio.h and replaced cout with printf
> > the code compiled and the result shown.
> > Can someone explaine why I couldn't use iostream
> > header ?
> >
> > Thanks
> > Titi
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log =
files
> > for problems? Stop! Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=
=3D121642
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=
=3D121642
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D GCv3.12 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
GCS d-(++) s+: a? C++ UL+>++++ P+
L++ E--- W+(+++) N++ o? K? w--- O? M+
V? PS- PE+ Y-(--) PGP- t+++ 5? X R tv-- b+
DI+++ D+ G e* h- !r !y
=3D=3D=3D=3D=3D=3D=3D=3D=3D END GCv3.12 =3D=3D=3D=3D=3D=3D=3D=3D
|