|
From: Todd G. <pi...@ea...> - 2004-07-19 10:42:04
|
Hello,
It seems that this response from Paul <pa...@al...> in the
"alt.comp.lang.learn.c++" may be applicable to the issue of the console
window automatically closing. Another place the suggestion below is shown
is in the auto generated hello world from dev-cpp for Windows.
<begin forward from pa...@al...>
<snip>
Right. cin.get() would be better to use as not all systems implement
either system("pause") or implement it in the same way. The point of C++
is that it *is* platform independent - irrespective of what vendors say!
<snip>
> using namespace std;
>
> int main (int argc, char *argv[])
> {
> cout << "Hello World!" << endl;
> cout << "Press ENTER to continue..." << endl; cin.get(); return 0;
> }
With the exception of incorrect header, the only other point on that code
is that it would have been better to have using cin and using endl rather
than including the whole std namespace.
TTFN
Paul
--
"There are four stages to any war
First they ignore you, then they laugh at you
Then they fight you, then YOU win."
Ghandi
Todd
|