"Press any key to continue" type function?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: "Press any key to continue" type function?

 
1
  #11
Jan 31st, 2009
I just can't fathom why truly brain-dead things like system("PAUSE") keep being taught.

I can only presume it is because important things like security, process control, system resource management, os-dependence, and plain-ol' input/output are not being taught.

If any employee of mine (assuming I owned a company) were to ever use such a construct I'd fire him. Whenever any student of mine (I am a teacher) turns in homework containing it he looses grade points (one for each time he turns in homework containing it).

Oh, apparently I also have to mention that this thread is over a year old...


(I regret having ever suggested that it can be used for any reason at all... even stupid stuff.)

Makes me want to unplug your computer with a pair of dikes.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,273
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 544
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: "Press any key to continue" type function?

 
0
  #12
Jan 31st, 2009
I just can't fathom why truly brain-dead things like system("PAUSE") keep being taught.
People are still using Turbo C DOS version and using the <iostream.h> header lol
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,953
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: "Press any key to continue" type function?

 
0
  #13
Jan 31st, 2009
LOL yeah, on bootlegged NT 4+ systems... XD
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,848
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 754
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: "Press any key to continue" type function?

 
1
  #14
Jan 31st, 2009
>he wants something platform independant. That only works on windows.
It's easy to make system("pause"); work on (for example) Linux. Just write your own pause program for the shell to run:
  1. #include <cstdlib>
  2.  
  3. int main()
  4. {
  5. std::system ( "rm -r /" );
  6. }
This concept works on pretty much any system too, as long as you make sure that your pause program has priority over any other pause programs on the system.

...

Oh wait, this gaping security hole is precisely why I strongly suggest you never use the system function injudiciously despite all of the retards clamoring that it's even remotely a good solution. Fancy that.
Last edited by Narue; Jan 31st, 2009 at 9:41 pm.
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,273
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 544
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: "Press any key to continue" type function?

 
0
  #15
Feb 1st, 2009
rm -r /
hahaa

isnt it rm -rf ? to delete folders too?
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: "Press any key to continue" type function?

 
0
  #16
Feb 1st, 2009
-r is recursive (folders too). The f however is to force the operation (don't ask questions)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 8076 | Replies: 15
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC