Re: TIB: Convert


[Prev][Next][Index][Thread]

Re: TIB: Convert




The answer to this may depend upon what version of C++ that you're working 
in.  I know that in Micrsoft Visual C++ 5.0 and 6.0 automatically wait for a 
key to be pressed upon termination, but I have helped someone with a similar 
problem in the past.  What I'm doing doesn't rely on the <stdio.h> header, 
but upon the <iostream.h> header (you know...the cin and cout variables - 
basically...).  If you have these header files (which you probably do), 
making sure to include them, just add the following function.


//Function Declaration
void Pause( );

//Function Definitions
void Pause( )
{
  char temp;   //a temporary variable - it has no point
 cout << "Press enter to continue"; //Prompt
  cin >> temp;  //input the variable (or nothing if enter is pressed);
}


Now all that you should have to do is call Pause from your program (by typing 
"Pause( );" by itself on an indentes line).  I hope this helps/is compatible 
with the type of C++ you're using.


Ted


Follow-Ups: