Please can anybody tell me the difference in return 0 and system ('pause');
- 4 Contributors
- forum 8 Replies
- 2,154 Views
- 2 Days Discussion Span
- commentLatest Postby Tom GunnLatest Post
Mar 31, 2016 It’s not portable: Using system makes the program very non-portable i.e. This works only on systems that have the pause command at the system level, like DOS or Windows. But not Linux, MAC OSX and most others. Let us take a simple C code to output Hello World using system(“pause”).
yellowSnow607
Please can anybody tell me the difference in return 0 and system ('pause');
System Pause In Dev C++
return 0 means the value 0 (usually some type of int) is returned from a function to the caller of the function.
system() is a library function that makes calls to OS commands/programs. system('pause') calls the 'pause' command in DOS/Windows. Run the pause command in a command shell to see what it does.
C++ System Pause
P: n/a | In article <di**********@news.net.uni-c.dk>, Paminu <ja******@asd.com> wrote: :Is there something like system('PAUSE') for linux? As far as this newsgroup is concerned, the exact replacement is system('PAUSE'); That's because as far as this newsgroup is concerned, PAUSE has an unidentified system-dependant function. If the functionality of PAUSE were to be described, then a Unix or Linux newsgroup would be able to tell you what the nearest Linux equivilent would be. On some systems, PAUSE means 'suspend CPU activity on the system until there is an interrupt'. On others, it means 'suspend the active process for 1 second'. On others, it means 'flush any pending output and wait until a key is pressed and then continue (without waiting for a newline.) On others, the newline is required. On others, it means 'print the error message associated with not finding a named program or command'. On others it means 'look for an executable program named PAUSE in the current directory and execute it, with whatever consequences that has.' Others yet it would mean 'look for an executable program named PAUSE in the currently defined list of program locations, and execute it, with whatever condequences that has.' Possibly the most common meaning, though, is 'Play a recording of your voice telling the dog to get his paws off of the furniture.' If that's the one you were looking for, see section 93.11 of the Linux FAQ, which discusses the various ways of getting high-fidelity playback of His Master's Voice on various kinds of sound cards and Midi Synthesizers. -- All is vanity. -- Ecclesiastes
|
|