Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 22nd, 2005, 1:43 AM   #21
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Smile

std::endl not only puts in a newline character '\n' but also flushes the output, a good thing to do.

Use cin.get() to make the console wait for a key to be pressed, it is by far the most portable code.
Dietrich is offline   Reply With Quote
Old Feb 22nd, 2005, 6:15 AM   #22
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Yea, but it outputs to screen and is ugly when running in terminals...
__________________

tempest is offline   Reply With Quote
Old Feb 22nd, 2005, 9:33 AM   #23
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Talking

Quote:
Originally Posted by tempest
Yea, but it outputs to screen and is ugly when running in terminals...
cin.get() doesn't output anything! In fact, you may want to give the user a hint to press the "any key"!
Dietrich is offline   Reply With Quote
Old Feb 22nd, 2005, 9:46 AM   #24
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
http://www.freeprogrammingresources.com/

is a good website for tutorials etc, also not just for C++.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Feb 22nd, 2005, 3:07 PM   #25
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Quote:
Originally Posted by Dietrich
cin.get() doesn't output anything! In fact, you may want to give the user a hint to press the "any key"!

Hmm, i'm going to try that out... i thought it did. Thats cool.
__________________

tempest is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:35 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC