P
pete
"PAUSE" is not a portable system command.
In other words, it won't work on all systems.
The code you post here, should not be undefined.
Learnig how best to write portable or correct code,
is pretty much the whole point of reading this newgroup.
N869
3. Terms and definitions
3.18
[#1] undefined behavior
behavior, upon use of a nonportable or erroneous program
construct, of erroneous data, or of indeterminately valued
objects, for which this International Standard imposes no
requirements
4. Conformance
[#3] A program that is correct in all other aspects,
operating on correct data, containing unspecified behavior
shall be a correct program and act in accordance with
5.1.2.3.
Seriously, is it out of consideration for others,
and not because of a problem that you have?
It doesn't happen on my windows box
when I open a command prompt window either.
It happened when I ran a program directly from MSVC
by clicking on an icon that looks like a red exclamation mark,
but I don't do that anymore.
No. That's not the reason.
It doesn't make the code easier to compile.
In other words, it won't work on all systems.
The code you post here, should not be undefined.
Learnig how best to write portable or correct code,
is pretty much the whole point of reading this newgroup.
N869
3. Terms and definitions
3.18
[#1] undefined behavior
behavior, upon use of a nonportable or erroneous program
construct, of erroneous data, or of indeterminately valued
objects, for which this International Standard imposes no
requirements
4. Conformance
[#3] A program that is correct in all other aspects,
operating on correct data, containing unspecified behavior
shall be a correct program and act in accordance with
5.1.2.3.
Seriously, is it out of consideration for others,
and not because of a problem that you have?
I went onto my Windows box and ran a few programs.
None of them closed the
console when they were done.
It doesn't happen on my windows box
when I open a command prompt window either.
It happened when I ran a program directly from MSVC
by clicking on an icon that looks like a red exclamation mark,
but I don't do that anymore.
No. That's not the reason.
It doesn't make the code easier to compile.