![]() |
|
#1
|
|||
|
|||
System("PAUSE") equivalent unixis there a system("PAUSE") equivalent in UNIX
|
|||
|
#2
|
|||
|
|||
Re: System("PAUSE") equivalent unixQuote:
I hardly ever need something like system("PAUSE") for my Windows applications or my Linux applications, but I would probably change the functionality slightly so that I could use standard library functions on both and do something like this: CPP / C++ / C Code:
Works for me on Windows and on Linux with no changes to the source code. Code:
Note that this is a valid C program and also a valid C++ program, but C++ programmers would probably use cout<< instead of printf, and cin.get() instead of getchar(). Regards, Dave Footnote: The Windows built-in command "PAUSE" is kind of like printing the message and then executing getch() and throwing away the char. I have never seen a Linux system with a "PAUSE" system command, but it is undoubtedly possible to implement such a thing. (I have also never seen a C/C++ compiler distribution that has getch(), unless you use ncurses, which is typically available on Linux systems. Since ncurses is not necessarily included with Linux distributions, and is often not available with Windows C compilers, I usually don't use ncurses unless I really, really need some special screen functionality but don't need a full-fledged GUI program. Since my goal is portability across platforms, I (usually) avoid using system commands (or C library functions) for which I am not prepared to supply the source code so that the application can be re-compiled for virtually any platform. |
|
#3
|
||||
|
||||
Re: System("PAUSE") equivalent unixAlso, check this info to see why you don't want to use system("PAUSE") in the first place -- and what to replace it with...
__________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy/Paste from Excel into an FL_Input field UNIX app doesn't work ? | jl_nicoue | FLTK Forum | 1 | 26-Jul-2006 13:15 |
| Reading Excel Sheets on Unix Platform | tanmay | C++ Forum | 2 | 24-Sep-2005 10:49 |
| Unix! | Zorachus | Computer Software Forum - Linux | 21 | 07-Aug-2005 10:33 |
| Unix Flavours | JdS | Computer Software Forum - Linux | 3 | 14-Jun-2005 10:36 |
| equivalent expressions | 81k5blzr | C Programming Language | 2 | 14-Feb-2005 13:52 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The