No need to explain, the code talks better :
#include <conio.h>
// ...
printf("please press P key to pause \n ");
int key = 0;
while(1)
{
if (_kbhit())
{
key =_getch();
if (key == 'P')
break;
}
}
More Related Contents:
- Reading a character with scanf_s
- How to build a DLL from the command line in Windows using MSVC
- LoadLibrary() an EXE?
- Should C compilers immediately free "further unused" memories? [closed]
- What is the difference between ‘asm’, ‘__asm’ and ‘__asm__’?
- How does the Import Library work? Details?
- How can one grab a stack trace in C?
- what’s the differences between r and rb in fopen
- LPCSTR, LPCTSTR and LPTSTR
- How to implement getch() function of C in Linux?
- How to get screenshot of a window as bitmap object in C++?
- Can I get Unix’s pthread.h to compile in Windows?
- How to copy string to clipboard in C?
- How to check if a pointer is valid? [duplicate]
- c programming check if key pressed without stopping program
- R from C — Simplest Possible Helloworld
- How to obtain the correct physical size of the monitor?
- What is the purpose of the _chkstk() function?
- Fatal error: “No Target Architecture” in Visual Studio
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- Is it possible to call a non-exported function that resides in an exe?
- Building a shared library using gcc on Linux and MinGW on Windows
- How to check if a file is already open by another process in C?
- Terminate a process tree (C for Windows)
- how to use gettimeofday() or something equivalent with Visual Studio C++ 2008?
- Is there a way to use fopen_s() with GCC or at least create a #define about it?
- How can I take a screenshot and save it as JPEG on Windows?
- Equivalent to Windows getch() for Mac/Linux crashes
- How can I read a child process’s output?
- CreateDesktop() with vista and UAC on (C, windows)