|
From: Charles <cha...@at...> - 2001-12-01 19:11:18
|
Christiaan -
> whats wrong with pause?
>
> > Note that Jason's solution,
> > > If you add #include <cstdlib> at the top and the line: system("PAUSE")
> > is system-specific and therefore not portable.
> >
> > It is better to do this:
> >
> > #include <cstdio>
> >
> > printf("Press ENTER to continue");
> > fflush(stdout);
> > getchar();
When I say that it is not portable I mean that "pause" will not work on all
systems. I found this out recently because I have used it too. I made some
changes to my computer (installed Windows 98SE, switched to the Cygwin
compiler etc.). Now system("pause") will not work for me.
Code portability is a good thing.
Chuck
|