Re: just starting



* Jim Langston:
<sterling.mckay@xxxxxxxxx> wrote in message news:1169958279.800511.264380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
[snipped]

Basically it sounds like you want to wait for a key to be pressed before the DOS window closes. In C I would write:

while ( !kbhit() )

in C++ I would write:

std::cin.getch();
although the C++ method requires a carraige return.

'kbhit' is not a standard C function.

If it is available with your C compiler, it should also be available with your C++ compiler from the same vendor.

There is no difference between C and C++ in this respect except that /more/ (e.g. 'std::cin') is available in the C++ standard library.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
.



Relevant Pages

  • Re: Salford FTN 95 output window problem
    ... using Salford's/Silverfrost's FTN95 compiler, v.4.6.0, we are having ... When our program starts, a DOS window is automatically opened, to ... opposed to the regular black-on-white window, ... My guess is that you deleted the WINAPP directive that tells the compiler to ...
    (comp.lang.fortran)
  • Re: Hiding the DOS window in a stand-alone application
    ... A shame that TMW ... At least for the older compiler I use, ... to hide the DOS window ... You can either open the above mentioned file using notepad or the ...
    (comp.soft-sys.matlab)
  • Re: Russian Compiler PL/1 for Win32
    ... No any links to compiler. ... both my Vista and Win 7 machines are 64-bit. ... The DOS window error didn't show up until I tried running the executable. ... But I am curious as to why the DOS window in the 64-bit versions of various Windows doesn't support 32-bit executables. ...
    (comp.lang.pl1)
  • SOT: Turbo C 2 Question
    ... is there _any_ way at all to enable Turbo C 2.01 to ... is there a Borland DOS C compiler that will? ... long filenames when run in a DOS window? ...
    (comp.lang.c)