![]() |
|
#1
|
|||
|
|||
Console Will Not Stay Openhi there people, for some strange reason my code will not stay open what do i add in to get the console to stay open. Here is my code
CPP / C++ / C Code:
|
|
#2
|
|||
|
|||
Re: Console Will Not Stay OpenDid you read at all what I said in your other similar thread?
http://www.gidforums.com/t-14967.html CPP / C++ / C Code:
Run console programs from the console. And by running from the console I mean "open the console, navigate to the directory that contains your program, execute." Or put system("PAUSE") at the end, but I find that to be useless complicating of matters. Now if there are things you don't get in this, ask them in this thread. Someone around here most probably has the answers. EDIT If you don't want to run from console, you can add something like this at the end CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: Console Will Not Stay Openyhanks the system puase worked, and btw i did open it from the root
|
|
#4
|
|||
|
|||
Re: Console Will Not Stay OpenQuote:
But if you run the programs from the console, then why would you want to put something like system("PAUSE") at the end of the program? What is the use of keeping the program open? |
|
#5
|
|||
|
|||
Re: Console Will Not Stay Openhi there, i want to use a if else statment to make a application. I would like to make an application where i can ask the user for a password and if the password is correct there will be a console out saying well done, if it is not correct it will say better look next time, could you please quickly write me this little application and reply to this post.
Thanks |
|
#6
|
||||
|
||||
Re: Console Will Not Stay OpenQuote:
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#7
|
||||
|
||||
Re: Console Will Not Stay OpenI'm no pro, but some searching came up with this... http://forums.devarticles.com/c-c-help-52/cin-get-9130.html
Two solutions that seemed to be offered were... send cout an << endl; or call cin.ignore(); to flush out buffers before your cin.get(); Hope that is helpful Skip |
|
#8
|
|||
|
|||
Re: Console Will Not Stay OpenAdd this below your includes :
CPP / C++ / C Code:
Remove this from you code: CPP / C++ / C Code:
And add this in their place: CPP / C++ / C Code:
Last edited by admin II : 12-Aug-2007 at 20:43.
Reason: Please surround your C++ code with [cpp] ... [/cpp]
|
|
#9
|
|||
|
|||
Re: Console Will Not Stay OpenQuote:
CPP / C++ / C Code:
Did you try doing some simple testing like entering "5.7"? Take a look at this thread: http://www.gidforums.com/t-15133.html There is also a bit more advanced stringstream stuff which Dave explained, but also other useful hints. Dave also explains some basics of cin functionality, which every (decent, beginner-level) C++ book should cover. Problem nowadays, though, seems to be that no one buys books. Except us oldies. |
|
#10
|
|||
|
|||
Re: Console Will Not Stay OpenI apologize I didn't understand the question and my answer was SLOPPY.
This is what he is looking for. CPP / C++ / C Code:
Last edited by admin II : 12-Aug-2007 at 20:42.
Reason: Please surround your C++ code with [cpp] ... [/cpp]
|
Recent GIDBlog
Toyota - 2008 November Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Apache default page can't be visited | satimis | Apache Web Server Forum | 0 | 05-Apr-2007 05:40 |
| how to keep the console window from opening | tajjyarden | C++ Forum | 1 | 06-Feb-2007 14:40 |
| Bloodshed Dev C++ Project Options | JdS | C++ Forum | 6 | 11-Nov-2005 18:23 |
| The 100 prison doors problem | ruby_booby | C Programming Language | 6 | 09-Nov-2005 17:17 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The