![]() |
|
#1
|
|||
|
|||
Newbie Question about BorlandHi, I'm very new to C, so this is probably a stupid question. I've been writing simple programs ("Hello World") and stuff like that. When I run a program I've made a window opens up displaying results but it only stays open for a split second, then closes. How do I make the window stay open so I can see the results?
I'm using Borland C++ 5.02. thanks, Andy |
|
#2
|
|||
|
|||
|
This is an OS thing, more than a programming thig. If you double-click the executable, Windows only keeps DOS prompts open while the program is active. If you want to see the output, you've to have a DOS prompt open and run it within it.
So go to Start->Run, type "cmd" (for Win 2k/XP) or "command.com" for others, and cd to the correct directory, and run the program by typing it's name, without the .exe. Bear in mind, it's useful to keep the program & folder names short (<8 chars ideally) to make cd'ing easier! Another temporary solution is to have the program wait at the very end for your input, have a << cin statement right before exit. Or there is a pause() function in unistd.h, which pauses the program until you force quit it (Ctrl D or Ctrl C, maybe Z, one of them works anyway GF |
|
#3
|
|||
|
|||
|
Thanks! The cin works, though I had to include iostream. Thanks again!
|
|
#4
|
|||
|
|||
|
This also from another forum worked well too:
#include<conio.h> insert : getch(); where you want program to stop |
|
#5
|
||||
|
||||
Visual Basic is coolerI don't like Borland C++. I have that one and Visual Basic 6. VS 6 works nicer and is much easier to use. Everything is in GUI format and I don't have to do anything special to create project and such. I have several programs that work well in VS 6, but Borland will choke because it can't open .exe files. I am clueless.
I think I'll stick with one interface for now. I'll come back to Borland when I am a little more experienced. |
Recent GIDBlog
Python ebook by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| total newbie need help | grunt123 | Apache Web Server Forum | 2 | 04-Dec-2003 12:14 |
| newbie with stupid questions | JUNK KED | MySQL / PHP Forum | 1 | 16-Oct-2003 09:58 |
| a C input question | tmike | C Programming Language | 1 | 16-Sep-2003 03:31 |
| a noobish compiler question | Charunks | C++ Forum | 5 | 03-Sep-2003 03:18 |
| Code problem (a newbie question) | monkster87 | C++ Forum | 3 | 11-Aug-2003 13:46 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The