Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Feb 24th, 2005, 9:22 PM   #11
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
You're going to have to make it pause. After the call to your start() method, just add a call to getchar().
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower

Last edited by Mjordan2nd; Feb 24th, 2005 at 9:29 PM.
Mjordan2nd is offline   Reply With Quote
Old Feb 24th, 2005, 9:24 PM   #12
AlphaXero
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 AlphaXero is on a distinguished road
ok, ummm you lost me.
AlphaXero is offline   Reply With Quote
Old Feb 24th, 2005, 9:34 PM   #13
AlphaXero
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 AlphaXero is on a distinguished road
Great! it works now two or three more questions.
1. how can i clear the screen?
2. can i pause the screen so you must press enter to begin the start()function?
3. if i wanna make another function, do i add the next() function at the end of the start()?

--------------------
(edit) just ran into another problem, when i test it if i type in "goto the door" it exits the program.

Last edited by AlphaXero; Feb 24th, 2005 at 9:36 PM.
AlphaXero is offline   Reply With Quote
Old Feb 24th, 2005, 9:49 PM   #14
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
are you using windows or linux
uman is offline   Reply With Quote
Old Feb 24th, 2005, 9:50 PM   #15
AlphaXero
Newbie
 
Join Date: Feb 2005
Posts: 8
Rep Power: 0 AlphaXero is on a distinguished road
Linux - fedora core 3
AlphaXero is offline   Reply With Quote
Old Feb 24th, 2005, 10:17 PM   #16
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
OK at the top you must put
 #include <cstdlib>
Now to clear the screen you would put
system("clear"); //you can call any shell command like this.
To pause you would use the following bit of code:
char ch;
do
{
     cin.get(ch)
} while (ch!='\n'); //I think this will work but I have never tried it.
cin.clear(); /*I'm not sure if this is necessary, it's been a long time since I've used cin*/

By the way good job using Linux -- it rules!
uman 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 3:51 PM.

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