system("pause");

Started by
13 comments, last by Betrayer_of_Code 21 years, 4 months ago
And if you''re more used to stdio.h, you can use it too.

void DoPause(void){  printf("Press any key to continue...\n");  getch();} 


Or better yet...

void DoPause(char* Message){  printf("%s\n", *Message);  getch();} 
Advertisement
I think getch is from conio, you probably want getchar.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
quote:Original post by Apocalypse_Demon
If you really wanted to alter what the text was for the system pause command, then you''ll need to actually hex edit one of the dlls containing the information for the text for system pause. If you knew what dll to look in, then it shouldn''t be hard to hex edit it...


The pause command is executed by command.com, which isn''t something you should be hex editing.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
If you are using iostream, try doing something like so ...
void Pause( const char *pMessage = "Press any key to continue ..." );void Pause( const char *pMessage ){    cout << pMessage << ''\n'';    cin.get();} 

or ...
void Pause( const string pMessage = "Press any key to continue ..." );void Pause( const string pMessage ){    cout << pMessage << ''\n'';    cin.get();} 


There is probably a better member function for getting a single character though ...


Lektrix
[ Google || ACCU || BarrysWorld || E-Mail Me ]
[ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || CUJ || MSVC++ Library Fixes || BarrysWorld || [email=lektrix@barrysworld.com]E-Mail Me[/email] ]
Thanks guys. That really helped

My funnies:
"My mom was a ventriloquist and she always was throwing her voice. For ten years I thought the dog was telling me to kill my father."
and:
"The longest word in the english language is the one that follows the phrase, ''''And now a word from our sponsor''''."
BoC HomepageLuck is a Horse to ride like any other...Luckily im not a gambler, I dont know how to ride.

This topic is closed to new replies.

Advertisement